var nike = nike || {};
nike.cq = nike.cq || {};
nike.cq.extend = function (C) {
    var A = true;
    for (var B in C) {
        if (C.hasOwnProperty(B)) {
            if (this[B]) {
                throw new Error(B + " already exists in library - please use another name");
                A = false;
                break
            }
        }
    }
    if (A) {
        $.extend(this, C)
    }
};
nike.cq.Utils = nike.cq.Utils || {};
nike.cq.Utils.extend = function (A) {
    nike.cq.extend.call(this, A)
};
nike.cq.Utils.extend({
    isiOS: function () {
        return navigator.platform == "iPad" || navigator.platform == "iPhone" || navigator.platform == "iPod"
    },
    hasFlash: function () {
        return typeof (swfobject) != "undefined" && swfobject.hasFlashPlayerVersion("10.3")
    },
    getImageRenditionUrl: function (C, E) {
        var C = C || "",
            E = E || {}, D = E.width,
            B = E.height,
            G = E.quality,
            F = E.format || C.substr(C.lastIndexOf(".") + 1),
            A = [".dimg/"];
        if (D) {
            A.push(D)
        }
        A.push("x");
        if (B) {
            A.push(B)
        }
        if (G) {
            A.push("q");
            A.push(G)
        }
        A.push(".");
        A.push(F);
        C += A.join("");
        return C
    },
    validateInternalUrl: function (A) {
        if (A.toLowerCase().substring(0, 7).indexOf("http://") == -1) {
            if (A.toLowerCase().substring(A.length - 5).indexOf(".html") == -1) {
                A = A + ".html"
            }
        }
        return A
    },
    FlashBridge: (function () {
        var B = {}, A = function (C) {
                if (!B.hasOwnProperty(C)) {
                    B[C] = new function () {
                        var D = function () {}, E = {};
                        $.extend(this, {
                            onReady: function (F) {
                                if (F) {
                                    D = F
                                } else {
                                    return 'nike.cq.Utils.FlashBridge.getSWF("' + C + '").callOnReady()'
                                }
                            },
                            callOnReady: function () {
                                D()
                            },
                            registerEvent: function (F, G) {
                                E[F] = G
                            },
                            callEvent: function (F) {
                                if (E.hasOwnProperty(F) && typeof (E[F]) == "function") {
                                    E[F].call()
                                }
                            },
                            createEventHandler: function (F, G) {
                                this.registerEvent(F, G);
                                return [F, 'nike.cq.Utils.FlashBridge.getSWF("' + C + '").callEvent("' + F + '")']
                            }
                        });
                        return this
                    }
                }
                return B[C]
            };
        return {
            getSWF: A
        }
    })(),
    Cookies: (function () {
        var A = (function () {
            var D = {}, G = document.cookie != "" ? document.cookie.split(";") : [];
            for (var C = 0, B = G.length; C < B; C++) {
                var F = G[C].split("="),
                    E = F[0].replace(/^\s+|\s+$/g, "") || "",
                    H = "";
                if (F[1] != null) {
                    H = F[1].replace(/^\s+|\s+$/g, "") || ""
                }
                if (E != "") {
                    D[E] = unescape(H)
                }
            }
            return D
        })();
        return {
            has: function (B) {
                return A.hasOwnProperty(B)
            },
            getAll: function () {
                return A
            },
            get: function (B) {
                return A[B] || ""
            },
            set: function (C, F) {
                var C = C || "",
                    F = F || "",
                    G = "/",
                    E = "nike.com",
                    B = new Date((new Date()).getTime() + (1 * 365 * 1000 * 60 * 60 * 24)),
                    D = C + "=" + escape(F) + "; expires=" + B.toGMTString() + "; domain=" + E + "; path=" + G;
                document.cookie = D
            },
            cookieDelete: function (C) {
                var C = C || "",
                    F = "",
                    G = "/",
                    E = "nike.com",
                    B = new Date(),
                    D = C + "=" + escape(F) + "; expires=" + B.toGMTString() + "; domain=" + E + "; path=" + G;
                document.cookie = D
            }
        }
    })(),
    DomStorage: (function () {
        return {
            hasLocal: function () {
                return (window.localStorage) ? true : false
            },
            hasSession: function () {
                return (window.sessionStorage) ? true : false
            },
            set: function (B, A, D) {
                var C = (B) ? B : "session";
                switch (C) {
                    case "local":
                        localStorage.setItem(A, D);
                        break;
                    case "session":
                        sessionStorage.setItem(A, D);
                        break
                }
            },
            get: function (B, A, D) {
                var C = (B) ? B : "session";
                var E;
                switch (C) {
                    case "local":
                        E = localStorage.getItem(A);
                        break;
                    case "session":
                        E = sessionStorage.getItem(A);
                        break
                }
                return E
            },
            clear: function (A) {
                localStorage.removeItem(A);
                sessionStorage.removeItem(A)
            },
            clearAll: function (F) {
                var E = (F) ? F : "nike.cq.author.";
                var B = [];
                for (var D = 0, A = localStorage.length; D < A; D++) {
                    var C = localStorage.key(D);
                    if (C.indexOf(E) !== -1) {
                        B.push(localStorage.key(D))
                    }
                }
                for (var D = 0, A = sessionStorage.length; D < A; D++) {
                    var C = sessionStorage.key(D);
                    if (C.indexOf(E) !== -1) {
                        B.push(sessionStorage.key(D))
                    }
                }
                for (var D = 0, A = B.length; D < A; D++) {
                    localStorage.removeItem(B[D]);
                    sessionStorage.removeItem(B[D])
                }
            }
        }
    })(),
    Ellipsis: function (F, D) {
        var C = $(F);
        if (C.css("overflow") == "hidden") {
            var I = C.html();
            var K = $(C.clone()).hide().css({
                position: "absolute",
                overflow: "visible"
            }).width(D ? C.width() : "auto").height(D ? "auto" : C.height());
            C.after(K);

            function J() {
                return K.height() > C.height()
            }
            function A() {
                return K.width() > C.width()
            }
            var B = D ? J : A;
            if (B()) {
                var G = 0,
                    E = I.length;
                while (G <= E) {
                    var H = (E + G) / 2;
                    K.html(I.substr(0, H) + "&hellip;");
                    if (B()) {
                        E = H - 1;
                        if (G > E) {
                            H = (E + E - 2) / 2;
                            K.html(I.substr(0, H) + "&hellip;");
                            break
                        }
                    } else {
                        G = H + 1
                    }
                }
                C.html(K.html())
            }
            K.remove()
        }
    },
    detectLeftNav: function (A) {
        if (A === "tesla") {
            return $(".left-bar-menu").length > 0
        } else {
            if (A === "cq") {
                return $(".nike-cq-left-navigation").length > 0
            } else {
                return $(".left-bar-menu").length > 0 || $(".nike-cq-left-navigation").length > 0
            }
        }
    }
});
(function (A) {
    A.flexslider = function (D, N) {
        var B = A(D),
            L = A.extend({}, A.flexslider.defaults, N),
            G = L.namespace,
            I = ("ontouchstart" in window) || window.DocumentTouch && document instanceof DocumentTouch,
            C = (I) ? "touchend" : "click",
            H = L.direction === "vertical",
            J = L.reverse,
            M = (L.itemWidth > 0),
            F = L.animation === "fade",
            K = L.asNavFor !== "",
            E = {};
        A.data(D, "flexslider", B);
        E = {
            init: function () {
                B.animating = false;
                B.currentSlide = L.startAt;
                B.animatingTo = B.currentSlide;
                B.atEnd = (B.currentSlide === 0 || B.currentSlide === B.last);
                B.containerSelector = L.selector.substr(0, L.selector.search(" "));
                B.slides = A(L.selector, B);
                B.container = A(B.containerSelector, B);
                B.count = B.slides.length;
                B.syncExists = A(L.sync).length > 0;
                if (L.animation === "slide") {
                    L.animation = "swing"
                }
                B.prop = (H) ? "top" : "marginLeft";
                B.args = {};
                B.manualPause = false;
                B.transitions = !L.video && !F && L.useCSS && (function () {
                    var Q = document.createElement("div"),
                        P = ["perspectiveProperty", "WebkitPerspective", "MozPerspective", "OPerspective", "msPerspective"];
                    for (var O in P) {
                        if (Q.style[P[O]] !== undefined) {
                            B.pfx = P[O].replace("Perspective", "").toLowerCase();
                            B.prop = "-" + B.pfx + "-transform";
                            return true
                        }
                    }
                    return false
                }());
                if (L.controlsContainer !== "") {
                    B.controlsContainer = A(L.controlsContainer).length > 0 && A(L.controlsContainer)
                }
                if (L.manualControls !== "") {
                    B.manualControls = A(L.manualControls).length > 0 && A(L.manualControls)
                }
                if (L.randomize) {
                    B.slides.sort(function () {
                        return (Math.round(Math.random()) - 0.5)
                    });
                    B.container.empty().append(B.slides)
                }
                B.doMath();
                if (K) {
                    E.asNav.setup()
                }
                B.setup("init");
                if (L.controlNav) {
                    E.controlNav.setup()
                }
                if (L.directionNav) {
                    E.directionNav.setup()
                }
                if (L.keyboard && (A(B.containerSelector).length === 1 || L.multipleKeyboard)) {
                    A(document).bind("keyup", function (P) {
                        var O = P.keyCode;
                        if (!B.animating && (O === 39 || O === 37)) {
                            var Q = (O === 39) ? B.getTarget("next") : (O === 37) ? B.getTarget("prev") : false;
                            B.flexAnimate(Q, L.pauseOnAction)
                        }
                    })
                }
                if (L.mousewheel) {
                    B.bind("mousewheel", function (Q, S, P, O) {
                        Q.preventDefault();
                        var R = (S < 0) ? B.getTarget("next") : B.getTarget("prev");
                        B.flexAnimate(R, L.pauseOnAction)
                    })
                }
                if (L.pausePlay) {
                    E.pausePlay.setup()
                }
                if (L.slideshow) {
                    if (L.pauseOnHover) {
                        B.hover(function () {
                            if (!B.manualPlay && !B.manualPause) {
                                B.pause()
                            }
                        }, function () {
                            if (!B.manualPause && !B.manualPlay) {
                                B.play()
                            }
                        })
                    }(L.initDelay > 0) ? setTimeout(B.play, L.initDelay) : B.play()
                }
                if (I && L.touch) {
                    E.touch()
                }
                if (!F || (F && L.smoothHeight)) {
                    A(window).bind("resize focus", E.resize)
                }
                setTimeout(function () {
                    L.start(B)
                }, 200)
            },
            asNav: {
                setup: function () {
                    B.asNav = true;
                    B.animatingTo = Math.floor(B.currentSlide / B.move);
                    B.currentItem = B.currentSlide;
                    B.slides.removeClass(G + "active-slide").eq(B.currentItem).addClass(G + "active-slide");
                    B.slides.click(function (Q) {
                        Q.preventDefault();
                        var P = A(this),
                            O = P.index();
                        if (!A(L.asNavFor).data("flexslider").animating && !P.hasClass("active")) {
                            B.direction = (B.currentItem < O) ? "next" : "prev";
                            B.flexAnimate(O, L.pauseOnAction, false, true, true)
                        }
                    })
                }
            },
            controlNav: {
                setup: function () {
                    if (!B.manualControls) {
                        E.controlNav.setupPaging()
                    } else {
                        E.controlNav.setupManual()
                    }
                },
                setupPaging: function () {
                    var Q = (L.controlNav === "thumbnails") ? "control-thumbs" : "control-paging",
                        O = 1,
                        R;
                    B.controlNavScaffold = A('<ol class="' + G + "control-nav " + G + Q + '"></ol>');
                    if (B.pagingCount > 1) {
                        for (var P = 0; P < B.pagingCount; P++) {
                            R = (L.controlNav === "thumbnails") ? '<img src="' + B.slides.eq(P).attr("data-thumb") + '"/>' : "<a>" + O + "</a>";
                            B.controlNavScaffold.append("<li>" + R + "</li>");
                            O++
                        }
                    }(B.controlsContainer) ? A(B.controlsContainer).append(B.controlNavScaffold) : B.append(B.controlNavScaffold);
                    E.controlNav.set();
                    E.controlNav.active();
                    B.controlNavScaffold.delegate("a, img", C, function (S) {
                        S.preventDefault();
                        var U = A(this),
                            T = B.controlNav.index(U);
                        if (!U.hasClass(G + "active")) {
                            B.direction = (T > B.currentSlide) ? "next" : "prev";
                            B.flexAnimate(T, L.pauseOnAction)
                        }
                    });
                    if (I) {
                        B.controlNavScaffold.delegate("a", "click touchstart", function (S) {
                            S.preventDefault()
                        })
                    }
                },
                setupManual: function () {
                    B.controlNav = B.manualControls;
                    E.controlNav.active();
                    B.controlNav.live(C, function (O) {
                        O.preventDefault();
                        var Q = A(this),
                            P = B.controlNav.index(Q);
                        if (!Q.hasClass(G + "active")) {
                            (P > B.currentSlide) ? B.direction = "next" : B.direction = "prev";
                            B.flexAnimate(P, L.pauseOnAction)
                        }
                    });
                    if (I) {
                        B.controlNav.live("click touchstart", function (O) {
                            O.preventDefault()
                        })
                    }
                },
                set: function () {
                    var O = (L.controlNav === "thumbnails") ? "img" : "a";
                    B.controlNav = A("." + G + "control-nav li " + O, (B.controlsContainer) ? B.controlsContainer : B)
                },
                active: function () {
                    B.controlNav.removeClass(G + "active").eq(B.animatingTo).addClass(G + "active")
                },
                update: function (O, P) {
                    if (B.pagingCount > 1 && O === "add") {
                        B.controlNavScaffold.append(A("<li><a>" + B.count + "</a></li>"))
                    } else {
                        if (B.pagingCount === 1) {
                            B.controlNavScaffold.find("li").remove()
                        } else {
                            B.controlNav.eq(P).closest("li").remove()
                        }
                    }
                    E.controlNav.set();
                    (B.pagingCount > 1 && B.pagingCount !== B.controlNav.length) ? B.update(P, O) : E.controlNav.active()
                }
            },
            directionNav: {
                setup: function () {
                    var O = A('<ul class="' + G + 'direction-nav"><li><a class="' + G + 'prev" href="#">' + L.prevText + '</a></li><li><a class="' + G + 'next" href="#">' + L.nextText + "</a></li></ul>");
                    if (B.controlsContainer) {
                        A(B.controlsContainer).append(O);
                        B.directionNav = A("." + G + "direction-nav li a", B.controlsContainer)
                    } else {
                        B.append(O);
                        B.directionNav = A("." + G + "direction-nav li a", B)
                    }
                    E.directionNav.update();
                    B.directionNav.bind(C, function (P) {
                        P.preventDefault();
                        var Q = (A(this).hasClass(G + "next")) ? B.getTarget("next") : B.getTarget("prev");
                        B.flexAnimate(Q, L.pauseOnAction)
                    });
                    if (I) {
                        B.directionNav.bind("click touchstart", function (P) {
                            P.preventDefault()
                        })
                    }
                },
                update: function () {
                    var O = G + "disabled";
                    if (B.pagingCount === 1) {
                        B.directionNav.addClass(O)
                    } else {
                        if (!L.animationLoop) {
                            if (B.animatingTo === 0) {
                                B.directionNav.removeClass(O).filter("." + G + "prev").addClass(O)
                            } else {
                                if (B.animatingTo === B.last) {
                                    B.directionNav.removeClass(O).filter("." + G + "next").addClass(O)
                                } else {
                                    B.directionNav.removeClass(O)
                                }
                            }
                        } else {
                            B.directionNav.removeClass(O)
                        }
                    }
                }
            },
            pausePlay: {
                setup: function () {
                    var O = A('<div class="' + G + 'pauseplay"><a></a></div>');
                    if (B.controlsContainer) {
                        B.controlsContainer.append(O);
                        B.pausePlay = A("." + G + "pauseplay a", B.controlsContainer)
                    } else {
                        B.append(O);
                        B.pausePlay = A("." + G + "pauseplay a", B)
                    }
                    E.pausePlay.update((L.slideshow) ? G + "pause" : G + "play");
                    B.pausePlay.bind(C, function (P) {
                        P.preventDefault();
                        if (A(this).hasClass(G + "pause")) {
                            B.manualPause = true;
                            B.manualPlay = false;
                            B.pause()
                        } else {
                            B.manualPause = false;
                            B.manualPlay = true;
                            B.play()
                        }
                    });
                    if (I) {
                        B.pausePlay.bind("click touchstart", function (P) {
                            P.preventDefault()
                        })
                    }
                },
                update: function (O) {
                    (O === "play") ? B.pausePlay.removeClass(G + "pause").addClass(G + "play").text(L.playText) : B.pausePlay.removeClass(G + "play").addClass(G + "pause").text(L.pauseText)
                }
            },
            touch: function () {
                var T, R, P, U, X, V, S = false;
                D.addEventListener("touchstart", Q, false);

                function Q(Y) {
                    if (B.animating) {
                        Y.preventDefault()
                    } else {
                        if (Y.touches.length === 1) {
                            B.pause();
                            U = (H) ? B.h : B.w;
                            V = Number(new Date());
                            P = (M && J && B.animatingTo === B.last) ? 0 : (M && J) ? B.limit - (((B.itemW + L.itemMargin) * B.move) * B.animatingTo) : (M && B.currentSlide === B.last) ? B.limit : (M) ? ((B.itemW + L.itemMargin) * B.move) * B.currentSlide : (J) ? (B.last - B.currentSlide + B.cloneOffset) * U : (B.currentSlide + B.cloneOffset) * U;
                            T = (H) ? Y.touches[0].pageY : Y.touches[0].pageX;
                            R = (H) ? Y.touches[0].pageX : Y.touches[0].pageY;
                            D.addEventListener("touchmove", O, false);
                            D.addEventListener("touchend", W, false)
                        }
                    }
                }
                function O(Y) {
                    X = (H) ? T - Y.touches[0].pageY : T - Y.touches[0].pageX;
                    S = (H) ? (Math.abs(X) < Math.abs(Y.touches[0].pageX - R)) : (Math.abs(X) < Math.abs(Y.touches[0].pageY - R));
                    if (!S || Number(new Date()) - V > 500) {
                        Y.preventDefault();
                        if (!F && B.transitions) {
                            if (!L.animationLoop) {
                                X = X / ((B.currentSlide === 0 && X < 0 || B.currentSlide === B.last && X > 0) ? (Math.abs(X) / U + 2) : 1)
                            }
                            B.setProps(P + X, "setTouch")
                        }
                    }
                }
                function W(a) {
                    D.removeEventListener("touchmove", O, false);
                    if (B.animatingTo === B.currentSlide && !S && !(X === null)) {
                        var Z = (J) ? -X : X,
                            Y = (Z > 0) ? B.getTarget("next") : B.getTarget("prev");
                        if (B.canAdvance(Y) && (Number(new Date()) - V < 550 && Math.abs(Z) > 50 || Math.abs(Z) > U / 2)) {
                            B.flexAnimate(Y, L.pauseOnAction)
                        } else {
                            if (!F) {
                                B.flexAnimate(B.currentSlide, L.pauseOnAction, true)
                            }
                        }
                    }
                    D.removeEventListener("touchend", W, false);
                    T = null;
                    R = null;
                    X = null;
                    P = null
                }
            },
            resize: function () {
                if (!B.animating && B.is(":visible")) {
                    if (!M) {
                        B.doMath()
                    }
                    if (F) {
                        E.smoothHeight()
                    } else {
                        if (M) {
                            B.slides.width(B.computedW);
                            B.update(B.pagingCount);
                            B.setProps()
                        } else {
                            if (H) {
                                B.viewport.height(B.h);
                                B.setProps(B.h, "setTotal")
                            } else {
                                if (L.smoothHeight) {
                                    E.smoothHeight()
                                }
                                B.newSlides.width(B.computedW);
                                B.setProps(B.computedW, "setTotal")
                            }
                        }
                    }
                }
            },
            smoothHeight: function (O) {
                if (!H || F) {
                    var P = (F) ? B : B.viewport;
                    (O) ? P.animate({
                        height: B.slides.eq(B.animatingTo).height()
                    }, O) : P.height(B.slides.eq(B.animatingTo).height())
                }
            },
            sync: function (O) {
                var Q = A(L.sync).data("flexslider"),
                    P = B.animatingTo;
                switch (O) {
                    case "animate":
                        Q.flexAnimate(P, L.pauseOnAction, false, true);
                        break;
                    case "play":
                        if (!Q.playing && !Q.asNav) {
                            Q.play()
                        }
                        break;
                    case "pause":
                        Q.pause();
                        break
                }
            }
        };
        B.flexAnimate = function (W, X, Q, S, T) {
            if (K && B.pagingCount === 1) {
                B.direction = (B.currentItem < W) ? "next" : "prev"
            }
            if (!B.animating && (B.canAdvance(W, T) || Q) && B.is(":visible")) {
                if (K && S) {
                    var P = A(L.asNavFor).data("flexslider");
                    B.atEnd = W === 0 || W === B.count - 1;
                    P.flexAnimate(W, true, false, true, T);
                    B.direction = (B.currentItem < W) ? "next" : "prev";
                    P.direction = B.direction;
                    if (Math.ceil((W + 1) / B.visible) - 1 !== B.currentSlide && W !== 0) {
                        B.currentItem = W;
                        B.slides.removeClass(G + "active-slide").eq(W).addClass(G + "active-slide");
                        W = Math.floor(W / B.visible)
                    } else {
                        B.currentItem = W;
                        B.slides.removeClass(G + "active-slide").eq(W).addClass(G + "active-slide");
                        return false
                    }
                }
                B.animating = true;
                B.animatingTo = W;
                L.before(B);
                if (X) {
                    B.pause()
                }
                if (B.syncExists && !T) {
                    E.sync("animate")
                }
                if (L.controlNav) {
                    E.controlNav.active()
                }
                if (!M) {
                    B.slides.removeClass(G + "active-slide").eq(W).addClass(G + "active-slide")
                }
                B.atEnd = W === 0 || W === B.last;
                if (L.directionNav) {
                    E.directionNav.update()
                }
                if (W === B.last) {
                    L.end(B);
                    if (!L.animationLoop) {
                        B.pause()
                    }
                }
                if (!F) {
                    var V = (H) ? B.slides.filter(":first").height() : B.computedW,
                        U, R, O;
                    if (M) {
                        U = (L.itemWidth > B.w) ? L.itemMargin * 2 : L.itemMargin;
                        O = ((B.itemW + U) * B.move) * B.animatingTo;
                        R = (O > B.limit && B.visible !== 1) ? B.limit : O
                    } else {
                        if (B.currentSlide === 0 && W === B.count - 1 && L.animationLoop && B.direction !== "next") {
                            R = (J) ? (B.count + B.cloneOffset) * V : 0
                        } else {
                            if (B.currentSlide === B.last && W === 0 && L.animationLoop && B.direction !== "prev") {
                                R = (J) ? 0 : (B.count + 1) * V
                            } else {
                                R = (J) ? ((B.count - 1) - W + B.cloneOffset) * V : (W + B.cloneOffset) * V
                            }
                        }
                    }
                    B.setProps(R, "", L.animationSpeed);
                    if (B.transitions) {
                        if (!L.animationLoop || !B.atEnd) {
                            B.animating = false;
                            B.currentSlide = B.animatingTo
                        }
                        B.container.unbind("webkitTransitionEnd transitionend");
                        B.container.bind("webkitTransitionEnd transitionend", function () {
                            B.wrapup(V)
                        })
                    } else {
                        B.container.animate(B.args, L.animationSpeed, L.easing, function () {
                            B.wrapup(V)
                        })
                    }
                } else {
                    if (!I) {
                        B.slides.eq(B.currentSlide).fadeOut(L.animationSpeed, L.easing);
                        B.slides.eq(W).fadeIn(L.animationSpeed, L.easing, B.wrapup)
                    } else {
                        B.slides.eq(B.currentSlide).css({
                            opacity: 0,
                            zIndex: 1
                        });
                        B.slides.eq(W).css({
                            opacity: 1,
                            zIndex: 2
                        });
                        B.slides.unbind("webkitTransitionEnd transitionend");
                        B.slides.eq(B.currentSlide).bind("webkitTransitionEnd transitionend", function () {
                            L.after(B)
                        });
                        B.animating = false;
                        B.currentSlide = B.animatingTo
                    }
                } if (L.smoothHeight) {
                    E.smoothHeight(L.animationSpeed)
                }
            }
        };
        B.wrapup = function (O) {
            if (!F && !M) {
                if (B.currentSlide === 0 && B.animatingTo === B.last && L.animationLoop) {
                    B.setProps(O, "jumpEnd")
                } else {
                    if (B.currentSlide === B.last && B.animatingTo === 0 && L.animationLoop) {
                        B.setProps(O, "jumpStart")
                    }
                }
            }
            B.animating = false;
            B.currentSlide = B.animatingTo;
            L.after(B)
        };
        B.animateSlides = function () {
            if (!B.animating) {
                B.flexAnimate(B.getTarget("next"))
            }
        };
        B.pause = function () {
            clearInterval(B.animatedSlides);
            B.playing = false;
            if (L.pausePlay) {
                E.pausePlay.update("play")
            }
            if (B.syncExists) {
                E.sync("pause")
            }
        };
        B.play = function () {
            B.animatedSlides = setInterval(B.animateSlides, L.slideshowSpeed);
            B.playing = true;
            if (L.pausePlay) {
                E.pausePlay.update("pause")
            }
            if (B.syncExists) {
                E.sync("play")
            }
        };
        B.canAdvance = function (Q, O) {
            var P = (K) ? B.pagingCount - 1 : B.last;
            return (O) ? true : (K && B.currentItem === B.count - 1 && Q === 0 && B.direction === "prev") ? true : (K && B.currentItem === 0 && Q === B.pagingCount - 1 && B.direction !== "next") ? false : (Q === B.currentSlide && !K) ? false : (L.animationLoop) ? true : (B.atEnd && B.currentSlide === 0 && Q === P && B.direction !== "next") ? false : (B.atEnd && B.currentSlide === P && Q === 0 && B.direction === "next") ? false : true
        };
        B.getTarget = function (O) {
            B.direction = O;
            if (O === "next") {
                return (B.currentSlide === B.last) ? 0 : B.currentSlide + 1
            } else {
                return (B.currentSlide === 0) ? B.last : B.currentSlide - 1
            }
        };
        B.setProps = function (R, O, P) {
            var Q = (function () {
                var S = (R) ? R : ((B.itemW + L.itemMargin) * B.move) * B.animatingTo,
                    T = (function () {
                        if (M) {
                            return (O === "setTouch") ? R : (J && B.animatingTo === B.last) ? 0 : (J) ? B.limit - (((B.itemW + L.itemMargin) * B.move) * B.animatingTo) : (B.animatingTo === B.last) ? B.limit : S
                        } else {
                            switch (O) {
                                case "setTotal":
                                    return (J) ? ((B.count - 1) - B.currentSlide + B.cloneOffset) * R : (B.currentSlide + B.cloneOffset) * R;
                                case "setTouch":
                                    return (J) ? R : R;
                                case "jumpEnd":
                                    return (J) ? R : B.count * R;
                                case "jumpStart":
                                    return (J) ? B.count * R : R;
                                default:
                                    return R
                            }
                        }
                    }());
                return (T * -1) + "px"
            }());
            if (B.transitions) {
                Q = (H) ? "translate3d(0," + Q + ",0)" : "translate3d(" + Q + ",0,0)";
                P = (P !== undefined) ? (P / 1000) + "s" : "0s";
                B.container.css("-" + B.pfx + "-transition-duration", P)
            }
            B.args[B.prop] = Q;
            if (B.transitions || P === undefined) {
                B.container.css(B.args)
            }
        };
        B.setup = function (P) {
            if (!F) {
                var Q, O;
                if (P === "init") {
                    B.viewport = A('<div class="' + G + 'viewport"></div>').css({
                        overflow: "hidden",
                        position: "relative"
                    }).appendTo(B).append(B.container);
                    B.cloneCount = 0;
                    B.cloneOffset = 0;
                    if (J) {
                        O = A.makeArray(B.slides).reverse();
                        B.slides = A(O);
                        B.container.empty().append(B.slides)
                    }
                }
                if (L.animationLoop && !M) {
                    B.cloneCount = 2;
                    B.cloneOffset = 1;
                    if (P !== "init") {
                        B.container.find(".clone").remove()
                    }
                    B.container.append(B.slides.first().clone().addClass("clone")).prepend(B.slides.last().clone().addClass("clone"))
                }
                B.newSlides = A(L.selector, B);
                Q = (J) ? B.count - 1 - B.currentSlide + B.cloneOffset : B.currentSlide + B.cloneOffset;
                if (H && !M) {
                    B.container.height((B.count + B.cloneCount) * 200 + "%").css("position", "absolute").width("100%");
                    setTimeout(function () {
                        B.newSlides.css({
                            display: "block"
                        });
                        B.doMath();
                        B.viewport.height(B.h);
                        B.setProps(Q * B.h, "init")
                    }, (P === "init") ? 100 : 0)
                } else {
                    B.container.width((B.count + B.cloneCount) * 200 + "%");
                    B.setProps(Q * B.computedW, "init");
                    setTimeout(function () {
                        B.doMath();
                        B.newSlides.css({
                            width: B.computedW,
                            "float": "left",
                            display: "block"
                        });
                        if (L.smoothHeight) {
                            E.smoothHeight()
                        }
                    }, (P === "init") ? 100 : 0)
                }
            } else {
                B.slides.css({
                    width: "100%",
                    "float": "left",
                    marginRight: "-100%",
                    position: "relative"
                });
                if (P === "init") {
                    if (!I) {
                        B.slides.eq(B.currentSlide).fadeIn(L.animationSpeed, L.easing)
                    } else {
                        B.slides.css({
                            opacity: 0,
                            display: "block",
                            webkitTransition: "opacity " + L.animationSpeed / 1000 + "s ease",
                            zIndex: 1
                        }).eq(B.currentSlide).css({
                            opacity: 1,
                            zIndex: 2
                        })
                    }
                }
                if (L.smoothHeight) {
                    E.smoothHeight()
                }
            } if (!M) {
                B.slides.removeClass(G + "active-slide").eq(B.currentSlide).addClass(G + "active-slide")
            }
        };
        B.doMath = function () {
            var O = B.slides.first(),
                R = L.itemMargin,
                P = L.minItems,
                Q = L.maxItems;
            B.w = B.width();
            B.h = O.height();
            B.boxPadding = O.outerWidth() - O.width();
            if (M) {
                B.itemT = L.itemWidth + R;
                B.minW = (P) ? P * B.itemT : B.w;
                B.maxW = (Q) ? Q * B.itemT : B.w;
                B.itemW = (B.minW > B.w) ? (B.w - (R * P)) / P : (B.maxW < B.w) ? (B.w - (R * Q)) / Q : (L.itemWidth > B.w) ? B.w : L.itemWidth;
                B.visible = Math.floor(B.w / (B.itemW + R));
                B.move = (L.move > 0 && L.move < B.visible) ? L.move : B.visible;
                B.pagingCount = Math.ceil(((B.count - B.visible) / B.move) + 1);
                B.last = B.pagingCount - 1;
                B.limit = (B.pagingCount === 1) ? 0 : (L.itemWidth > B.w) ? ((B.itemW + (R * 2)) * B.count) - B.w - R : ((B.itemW + R) * B.count) - B.w - R
            } else {
                B.itemW = B.w;
                B.pagingCount = B.count;
                B.last = B.count - 1
            }
            B.computedW = B.itemW - B.boxPadding
        };
        B.update = function (P, O) {
            B.doMath();
            if (!M) {
                if (P < B.currentSlide) {
                    B.currentSlide += 1
                } else {
                    if (P <= B.currentSlide && P !== 0) {
                        B.currentSlide -= 1
                    }
                }
                B.animatingTo = B.currentSlide
            }
            if (L.controlNav && !B.manualControls) {
                if ((O === "add" && !M) || B.pagingCount > B.controlNav.length) {
                    E.controlNav.update("add")
                } else {
                    if ((O === "remove" && !M) || B.pagingCount < B.controlNav.length) {
                        if (M && B.currentSlide > B.last) {
                            B.currentSlide -= 1;
                            B.animatingTo -= 1
                        }
                        E.controlNav.update("remove", B.last)
                    }
                }
            }
            if (L.directionNav) {
                E.directionNav.update()
            }
        };
        B.addSlide = function (O, Q) {
            var P = A(O);
            B.count += 1;
            B.last = B.count - 1;
            if (H && J) {
                (Q !== undefined) ? B.slides.eq(B.count - Q).after(P) : B.container.prepend(P)
            } else {
                (Q !== undefined) ? B.slides.eq(Q).before(P) : B.container.append(P)
            }
            B.update(Q, "add");
            B.slides = A(L.selector + ":not(.clone)", B);
            B.setup();
            L.added(B)
        };
        B.removeSlide = function (O) {
            var P = (isNaN(O)) ? B.slides.index(A(O)) : O;
            B.count -= 1;
            B.last = B.count - 1;
            if (isNaN(O)) {
                A(O, B.slides).remove()
            } else {
                (H && J) ? B.slides.eq(B.last).remove() : B.slides.eq(O).remove()
            }
            B.doMath();
            B.update(P, "remove");
            B.slides = A(L.selector + ":not(.clone)", B);
            B.setup();
            L.removed(B)
        };
        E.init()
    };
    A.flexslider.defaults = {
        namespace: "flex-",
        selector: ".slides > li",
        animation: "fade",
        easing: "swing",
        direction: "horizontal",
        reverse: false,
        animationLoop: true,
        smoothHeight: false,
        startAt: 0,
        slideshow: true,
        slideshowSpeed: 7000,
        animationSpeed: 600,
        initDelay: 0,
        randomize: false,
        pauseOnAction: true,
        pauseOnHover: false,
        useCSS: true,
        touch: true,
        video: false,
        controlNav: true,
        directionNav: true,
        prevText: "Previous",
        nextText: "Next",
        keyboard: true,
        multipleKeyboard: false,
        mousewheel: false,
        pausePlay: false,
        pauseText: "Pause",
        playText: "Play",
        controlsContainer: "",
        manualControls: "",
        sync: "",
        asNavFor: "",
        itemWidth: 0,
        itemMargin: 0,
        minItems: 0,
        maxItems: 0,
        move: 0,
        start: function () {},
        before: function () {},
        after: function () {},
        end: function () {},
        added: function () {},
        removed: function () {}
    };
    A.fn.flexslider = function (B) {
        if (B === undefined) {
            B = {}
        }
        if (typeof B === "object") {
            return this.each(function () {
                var F = A(this),
                    D = (B.selector) ? B.selector : ".slides > li",
                    E = F.find(D);
                if (E.length === 1) {
                    E.fadeIn(400);
                    if (B.start) {
                        B.start(F)
                    }
                } else {
                    if (F.data("flexslider") == undefined) {
                        new A.flexslider(this, B)
                    }
                }
            })
        } else {
            var C = A(this).data("flexslider");
            switch (B) {
                case "play":
                    C.play();
                    break;
                case "pause":
                    C.pause();
                    break;
                case "next":
                    C.flexAnimate(C.getTarget("next"), true);
                    break;
                case "prev":
                case "previous":
                    C.flexAnimate(C.getTarget("prev"), true);
                    break;
                default:
                    if (typeof B === "number") {
                        C.flexAnimate(B, true)
                    }
            }
        }
    }
})(jQuery);
nike.cq.Content = nike.cq.Content || {};
nike.cq.Content.extend = function (A) {
    nike.cq.extend.call(this, A)
};
nike.cq.Content.extend((function () {
    var B = function (F, I) {
        var K = typeof F == "object",
            G = K ? $(F) : null,
            D = !K ? F : null,
            L = typeof I == "string",
            N = L && I ? I : null,
            M = typeof I == "function",
            J = (M && I ? I : I ? I.onSuccess : function () {}) || function () {}, E = !M && I ? I.onComplete : null,
            H = !M && I ? I.onError : null;
        if (K && G && N) {
            return G.data(N.toLowerCase())
        } else {
            if (K && G) {
                return G.data()
            } else {
                if (D) {
                    $.ajax({
                        url: D,
                        success: function (O) {
                            if ($.isPlainObject(O)) {
                                var P = function (R) {
                                    var Q = {};
                                    for (dataItem in R) {
                                        if (R.hasOwnProperty(dataItem) && dataItem.replace(/sling\:key/gi, "sling_key").replace(/sling\:message/gi, "sling_message").indexOf(":") < 0) {
                                            if (typeof (R[dataItem]) == "string") {
                                                Q[dataItem] = R[dataItem]
                                            } else {
                                                if (typeof (R[dataItem]) == "object") {
                                                    Q[dataItem] = P(R[dataItem])
                                                }
                                            }
                                        }
                                    }
                                    return Q
                                };
                                J(P(O["jcr:content"] ? O["jcr:content"] : O))
                            } else {
                                J(O)
                            }
                        },
                        complete: E,
                        error: H
                    })
                }
            }
        }
        return null
    }, A = B($(".nike-cq-tesla-xml")) || {}, C = function (F, J) {
            var H = typeof (F) == "string" && F.indexOf("/") >= 0,
                I = !H && typeof (F) == "string",
                G = typeof (F) == "function",
                D = H ? F : window.location.href,
                E = I ? F : "",
                J = H ? J : I ? function () {} : F;
            return !I && !H && !G ? A : I ? A[E] : this.get(D.replace(/\.html/, ".10.json"), J)
        };
    return {
        get: B,
        getPageData: C
    }
})());
nike.cq.Content.extend((function () {
    var K = nike.cq.Content.getPageData("experienceId");
    var I = nike.cq.Content.getPageData("locale");
    var G = 3;
    var F = [];
    if (K) {
        F.push("/etc/designs/nike/i18n/" + I + "." + G);
        F.push("/etc/designs/nike/" + K + "/i18n/" + I + "." + G)
    } else {
        F.push(nike.cq.Content.getPageData("i18nPath"))
    }
    var H = null,
        J = [],
        B = false,
        E = [],
        D = function (N) {
            if (!H) {
                E.push(N);
                if (!B) {
                    B = true;
                    var M = function (R, Q) {
                        if ($.isPlainObject(R)) {
                            if (R.hasOwnProperty("sling:key") && R.hasOwnProperty("sling:message")) {
                                var O = R["sling:key"];
                                var P = R["sling:message"];
                                Q[O] = P
                            } else {
                                $.each(R, function (T, S) {
                                    M(S, Q)
                                })
                            }
                        }
                        return Q
                    };
                    var L = [];
                    $.each(F, function (P, Q) {
                        var O = $.Deferred();
                        nike.cq.Content.get(Q + ".json", function (R) {
                            var S = R || {};
                            if (Q.indexOf("/libs/cq/i18n/") !== 0) {
                                S = M(S, {})
                            }
                            J[P] = S;
                            O.resolve()
                        });
                        L.push(O.promise())
                    });
                    $.when.apply(this, L).then(function () {
                        H = {};
                        while (loadedDictionary = J.shift()) {
                            $.extend(H, loadedDictionary)
                        }
                        while (N = E.shift()) {
                            N(H)
                        }
                        B = false
                    })
                }
            } else {
                N(H)
            }
        }, A = function (N, P) {
            var N = N || "",
                L = $.isArray(N),
                M = $.isPlainObject(N),
                P = P || function () {}, O = function (Q, R) {
                    return R[Q] || ""
                };
            C(function (T) {
                var Q = "";
                if (L) {
                    var R = [];
                    for (var V = 0, S = N.length; V < S; V++) {
                        R.push(O(N[V], T))
                    }
                    Q = R
                } else {
                    if (M) {
                        var R = {};
                        for (var U in N) {
                            if (N.hasOwnProperty(U)) {
                                R[U] = O(N[U], T)
                            }
                        }
                        Q = R
                    } else {
                        Q = O(N, T)
                    }
                }
                P(Q)
            })
        }, C = function (L) {
            L = L || function () {};
            D(L)
        };
    return {
        i18n: {
            get: A,
            getAll: C
        }
    }
})());
nike.cq.Content.extend((function () {
    var M = nike.cq.Content.getPageData("experienceId");
    var L = nike.cq.Content.getPageData("locale");

    function F(P, O) {
        var Q = [];
        Q = [];
        Q.push("/etc/designs/nike/i18n/" + P + "." + H);
        Q.push("/etc/designs/nike/" + M + "/i18n/" + P + "." + H);
        $.each(Q, function (R, S) {
            $.ajax({
                url: S + ".json",
                async: false,
                success: function (T) {
                    if (S.indexOf("/libs/cq/i18n/") !== 0 && T.toString().indexOf("<!DOCTYPE html>") === -1) {
                        C(T, O)
                    }
                }
            })
        });
        return N
    }
    var K = null,
        G = {}, E = {}, A = {}, B = {}, J = {}, N = {}, D = false,
        H = 5,
        I = function (S, Q) {
            var P, O = [];
            F(S, Q);
            if (typeof (Q) === "object") {
                P = Q
            } else {
                switch (Q) {
                    case "fonts":
                        P = E;
                        break;
                    case "colours":
                        P = G;
                        break;
                    case "colourSelection":
                        P = B;
                        break;
                    case "size":
                        P = A;
                        break;
                    case "space":
                        P = J;
                        break;
                    default:
                        P = N
                }
            }
            for (var R in P) {
                if (P.hasOwnProperty(R)) {
                    if (Q === "colours") {
                        O.push(P[R].replace("#", ""))
                    } else {
                        O.push({
                            value: R,
                            text: P[R]
                        })
                    }
                }
            }
            return O
        }, C = function (S, P) {
            for (var R in S) {
                if (S.hasOwnProperty(R)) {
                    if (typeof S[R] == "object") {
                        if (S[R].hasOwnProperty("sling:key") && S[R].hasOwnProperty("sling:message")) {
                            var O = S[R]["sling:key"];
                            var Q = S[R]["sling:message"];
                            if (typeof (P) === "object") {
                                P[O] = Q
                            } else {
                                switch (P) {
                                    case "fonts":
                                        E[O] = Q;
                                        break;
                                    case "colours":
                                        G[O] = Q;
                                        break;
                                    case "colourSelection":
                                        B[O] = Q;
                                        break;
                                    case "size":
                                        A[O] = Q;
                                        break;
                                    case "space":
                                        J[O] = Q;
                                        break;
                                    default:
                                        N[O] = Q
                                }
                            }
                        } else {
                            $.each(S, function (U, T) {
                                C(T, P)
                            })
                        }
                    }
                }
            }
            if (typeof (P) === "object") {
                return P
            }
        };
    return {
        i18nInternal: {
            getAllByPath: I,
            loadedInternalColourDictionaries: G
        }
    }
})());
nike.cq.Content.Component = nike.cq.Content.Component || {};
nike.cq.Content.Component.extend = function (A) {
    nike.cq.Content.extend.call(this, A)
};
nike.cq.Content.Component.extend({
    Flash: function (E) {
        var M = !$.isPlainObject(E),
            B = M ? $(E) : null,
            V = (M ? nike.cq.Content.get(B) : E) || {}, I = V.src || "",
            N = V.width || "",
            K = V.height || "",
            P = typeof (V.autoplay) != "undefined" ? V.autoplay : false,
            S = typeof (V.loop) != "undefined" ? V.loop : false,
            A = typeof (V.menu) != "undefined" ? V.menu : false,
            J = V.quality || "",
            W = V.scale || "",
            C = V.salign || "",
            F = V.wmode || "",
            H = V.bgcolor || "",
            G = V.base || "",
            U = typeof (V.swliveconnect) != "undefined" ? V.swliveconnect : false,
            R = V.devicefont || "",
            D = V.allowscriptaccess || "",
            T = typeof (V.seamlesstabbing) != "undefined" ? V.seamlesstabbing : false,
            O = typeof (V.allowfullscreen) != "undefined" ? V.allowfullscreen : false,
            Q = typeof (V.allownetworking) != "undefined" ? V.allownetworking : false,
            L = V.flashvars || {};
        $.extend(this, {
            getSrc: function () {
                return I
            },
            getWidth: function () {
                return N
            },
            getHeight: function () {
                return K
            },
            getAutoPlay: function () {
                return P
            },
            getLoop: function () {
                return S
            },
            getMenu: function () {
                return A
            },
            getQuality: function () {
                return J
            },
            getScale: function () {
                return W
            },
            getSAlign: function () {
                return C
            },
            getWMode: function () {
                return F
            },
            getBgColor: function () {
                return H
            },
            getBase: function () {
                return G
            },
            getSWLiveConnect: function () {
                return U
            },
            getDeviceFont: function () {
                return R
            },
            getAllowScriptAccess: function () {
                return D
            },
            getSeamlessTabbing: function () {
                return T
            },
            getAllowFullScreen: function () {
                return O
            },
            getAllowNetworking: function () {
                return Q
            },
            getFlashVars: function () {
                return L
            }
        });
        return this
    }
});
nike.cq.Content.Component.extend({
    VideoPlayerType: {
        NONE: "",
        BRIGHTCOVE: "brightcove",
        SINA: "sina"
    },
    VideoPlayer: function (E) {
        var F = !$.isPlainObject(E),
            D = F ? $(E) : null,
            C = (F ? nike.cq.Content.get(D) : E) || {}, I = C.playerType || "",
            B = C.width || 908,
            H = C.height || 510;
        var A = function (J) {
            var J = $.extend({
                playerId: 390534381001,
                videoId: ""
            }, J);
            J.playerId = (/iPhone|iPod|iPad/i).test(navigator.userAgent) ? 713160923001 : J.playerId;
            $.extend(this, {
                getPlayerId: function () {
                    return J.playerId
                },
                getVideoId: function () {
                    return J.videoId
                },
                getAutoStart: function () {
                    if (J.autoStart == "undefined" || J.autoStart == null) {
                        return false
                    } else {
                        return J.autoStart
                    }
                }
            });
            return this
        }, G = function (J) {
                var J = $.extend({
                    sinaVideoId: ""
                }, J);
                return {
                    getVideoId: function () {
                        return J.sinaVideoId
                    }
                }
            };
        B = ((/iPhone|iPod/i).test(navigator.userAgent)) ? 480 : B;
        H = ((/iPhone|iPod/i).test(navigator.userAgent)) ? 320 : H;
        $.extend(this, {
            getWidth: function () {
                return B
            },
            getHeight: function () {
                return H
            },
            getPlayerType: function () {
                return I
            }
        });
        switch (I) {
            case nike.cq.Content.Component.VideoPlayerType.BRIGHTCOVE:
                $.extend(this, A(C));
                break;
            case nike.cq.Content.Component.VideoPlayerType.SINA:
                $.extend(this, G(C));
                break;
            default:
                break
        }
        return this
    }
});
nike.cq.Content.Component.extend({
    PesCarousel: function (I) {
        var J = !$.isPlainObject(I),
            G = J ? (I) : null,
            F = J ? nike.cq.Content.get(G) : I || {}, A = (F.width * F.numberOfSlidesInViewport) || 300,
            M = F.height || 550,
            H = F.delay || 5000,
            D = F.numberOfSlidesInViewport || 1,
            K = F.displayControlsInViewport ? true : false,
            E = F.displayControlsAtBottom ? true : false,
            L = F.displayCarouselAnimation ? true : false,
            B = F.slideby || 1,
            C = F.continuousLoop ? true : false;
        $.extend(this, {
            getWidth: function () {
                return A
            },
            getHeight: function () {
                return M
            },
            getDelay: function () {
                return H
            },
            getNumberOfSlidesInViewPort: function () {
                return D
            },
            displayControlsInViewPort: function () {
                return K
            },
            displayControlsAtBottom: function () {
                return E
            },
            displayCarouselAnimation: function () {
                return L
            },
            getSlideBy: function () {
                return B
            },
            getContinuousLoop: function () {
                return C
            }
        });
        return this
    }
});
nike.cq.Content.Component.extend({
    Share: new function () {
        var B = nike.cq.Content.getPageData("shareUrl") || window.location.href,
            A = nike.cq.Content.getPageData("shareShortUrl") || B;
        $.extend(this, {
            getUrl: function () {
                return B
            },
            getShortUrl: function () {
                return A
            }
        })
    }()
});
nike.cq.Content.Component.extend({
    Hotspot: function (B) {
        var C = $(B),
            A = C.children("div");
        var D = [];
        A.each(function () {
            var E = $(this),
                F = nike.cq.Content.get(E),
                G = $(document.createElement("div"));
            G.html(F.data);
            D.push({
                getData: function () {
                    return G.text()
                },
                getX: function () {
                    return F.x
                },
                getY: function () {
                    return F.y
                },
                getWidth: function () {
                    return F.width
                },
                getHeight: function () {
                    return F.height
                },
                getType: function () {
                    return F.type
                },
                getJcrName: function () {
                    return F.jcrName
                },
                getLink: function () {
                    return F.link || null
                }
            })
        });
        $.extend(this, {
            getData: function () {
                return D
            }
        });
        return this
    }
});
$(document).ready(function () {
    var A = A || $("body");
    if (A.data("cmsMode") !== "EDIT") {
        $(".nike-cq-hotspot-component").each(function () {
            new nike.cq.UI.Component.Hotspot(this)
        })
    }
});
nike.cq.Content.Component.extend({
    Slideshow: function (H, E) {
        var E = E ? E : false,
            I = !$.isArray(H) && !$.isPlainObject(H),
            F = I ? $(H) : null,
            D = I ? nike.cq.Content.get(F) : ($.isArray(H) ? {
                slides: H
            } : H) || {}, M = D.slides || [],
            J = E ? "nike-cq-carousel" : "nike-cq-" + (D.componentName || "slideshow"),
            G = D.wait || 5000,
            K = D.previousButtonTracking || "",
            B = D.nextButtonTracking || "",
            L = D.numberedSlideButtonTracking || "",
            C = D.autoSlide || "false",
            A = (function () {
                var P = [];
                if (I) {
                    F.find("." + J + "-slide").each(function () {
                        P.push(new nike.cq.Content.Component.Slide(this))
                    })
                } else {
                    for (var O = 0, N = M.length; O < N; O++) {
                        P.push(new nike.cq.Content.Component.Slide(M[O]))
                    }
                }
                return P
            })();
        $.extend(this, {
            getSlides: function () {
                return A
            },
            getWait: function () {
                return G
            },
            getAutoSlide: function () {
                if (C) {
                    if (C === "false") {
                        C = false
                    } else {
                        if (C === "true") {
                            C = true
                        }
                    }
                }
                return C
            },
            getComponentName: function () {
                return J
            },
            getPreviousButtonTracking: function () {
                return K
            },
            getNextButtonTracking: function () {
                return B
            },
            getNumberedSlideButtonTracking: function () {
                return L
            }
        });
        return this
    },
    Slide: function (A) {
        var F = !$.isPlainObject(A),
            D = F ? A : null,
            G = (F ? nike.cq.Content.get($(D)) : A) || {}, H = G.title || "",
            E = G.description || "",
            C = G.imageUrl || "",
            B = G.links || [];
        $.extend(this, {
            getTitle: function () {
                return H
            },
            getDescription: function () {
                return E
            },
            getImageUrl: function () {
                return C
            },
            getLinks: function () {
                return B
            }
        });
        return this
    },
    Carousel: function (A) {
        return nike.cq.Content.Component.Slideshow(A, true)
    }
});
nike.cq.Content.Component.extend({
    Product: (function () {
        var D = function (E, G, F) {
            return $.parseJSON($.ajax({
                url: "/apps/nike/product/configuration/services.json",
                data: {
                    productId: E,
                    cqLocale: G,
                    cqCountry: F
                },
                dataType: "json",
                async: false
            }).responseText)
        };
        var A = function (E, G) {
            var F = {};
            if (E.products != undefined && E.products.length > 0) {
                F = E.products[0]
            }
            G.call(this, F);
            return true
        };
        var C = function (F, G, E) {
            $.ajax({
                url: F,
                data: E,
                dataType: "jsonp",
                success: function (H) {
                    return A(H, G)
                }
            })
        };
        var B = function (G, I, H, E) {
            var F = D(G, I, H);
            $.ajax({
                url: F.get.url,
                data: F.get.data,
                dataType: "jsonp",
                success: function (J) {
                    return A(J, E)
                }
            })
        };
        return {
            getServices: D,
            getByUrl: C,
            getByProductId: B
        }
    })()
});
nike.cq.UI = nike.cq.UI || {};
nike.cq.UI.extend = function (A) {
    nike.cq.extend.call(this, A)
};
nike.cq.UI = nike.cq.UI || {};
nike.cq.UI.extend = function (A) {
    nike.cq.extend.call(this, A)
};
nike.cq.UI.extend({
    Overlay: function (C) {
        var C = $.extend({
            cssClass: "",
            autoOpen: true,
            isModal: true,
            onInit: function () {},
            onBeforeClose: function () {},
            onClose: function () {},
            open: function () {
                if (C.isModal) {
                    F.css("height", $(document).height()).show();
                    if (!A) {
                        D.css({
                            zIndex: 1000
                        }).appendTo(document.body);
                        A = true
                    }
                    D.show()
                }
                this.onOpen()
            },
            onOpen: function () {},
            onBeforeClose: function () {
                this.close()
            },
            close: function () {
                if (C.isModal) {
                    F.remove();
                    D.remove()
                }
            }
        }, C),
            E = "nike-cq-overlay-" + new Date().getTime() + Math.ceil(Math.random() * 1000),
            A = false,
            D = $("<div>", {
                "class": "nike-cq-overlay" + (C.cssClass != "" ? " " + C.cssClass : ""),
                id: E
            }),
            G = $("<div>", {
                "class": "nike-cq-overlay-content-element"
            }).appendTo(D),
            B = $("<button>", {
                "class": "nike-cq-overlay-close-button"
            }).appendTo(D),
            F = document.getElementById("nike-cq-overlay-modal-background") ? $("#nike-cq-overlay-modal-background").hide() : $('<div id="nike-cq-overlay-modal-background">').css({
                position: "absolute",
                top: 0,
                left: 0,
                zIndex: 999,
                height: $(document).height(),
                width: "100%"
            }).appendTo(document.body).hide();
        $.extend(this, {
            getElement: function () {
                return D
            },
            getContentElement: function () {
                return G
            },
            open: function () {
                C.open.apply(this, arguments)
            },
            onOpen: function () {
                C.onOpen.apply(this, arguments)
            },
            beforeClose: function () {
                C.onBeforeClose.apply(this, arguments)
            },
            close: function () {
                C.close.apply(this, arguments);
                C.onClose.apply(this, arguments)
            }
        });
        (function H() {
            var I = this;
            B.text("close");
            D.delegate(".nike-cq-overlay-close-button", "click", function () {
                I.beforeClose()
            });
            C.onInit.call(this);
            if (C.autoOpen) {
                this.open()
            }
        }).call(this);
        return this
    }
});
nike.cq.UI = nike.cq.UI || {};
nike.cq.UI.StringReplace = nike.cq.UI.StringReplace || {};
nike.cq.UI.StringReplace = (function () {
    var A = {
        replace: function (B, C, D) {
            $(B).filter(':contains("' + C + '")').each(function () {
                if ($(this).children().length == 0) {
                    var E = $(this).html();
                    E = E.replace(C, D);
                    $(this).html(E)
                }
            })
        }
    };
    return A
})();
nike.cq.UI = nike.cq.UI || {};
nike.cq.UI.ModalCarousel = function (E) {
    var E = $.extend({
        dialogClass: "nike-cq-modal-dialog",
        arrowClass: "nike-cq-modal-arrow",
        leftArrowClass: "nike-cq-modal-left",
        rightArrowClass: "nike-cq-modal-right",
        closeClass: "nike-cq-modal-close-button",
        useCloseButton: true,
        clickBackgroundToClose: false,
        backgroundClass: "nike-cq-modal-background",
        backgroundAppendSelector: "body",
        backgroundColor: "#FFF",
        backgroundOpacity: "0.7",
        dialogAppendSelector: "body"
    }, E);
    var G = $(document.createElement("div")).addClass("modal-container").appendTo(E.dialogAppendSelector);
    var C = $(document.createElement("div")).addClass(E.backgroundClass).appendTo(G);
    var I = $(E.dialogAppendSelector);
    var J = $(document.createElement("div")).addClass(E.dialogClass).appendTo(G);
    var B = $(document.createElement("div")).addClass(E.arrowClass + " " + E.leftArrowClass).appendTo(G);
    var F = $(document.createElement("div")).addClass(E.arrowClass + " " + E.rightArrowClass).appendTo(G);
    var K = [C, J, B, F];
    if (E.useCloseButton) {
        var D = $(document.createElement("div")).addClass(E.closeClass).appendTo(G);
        K.push(D)
    }
    var H = function (M) {
        var L = M ? true : false;
        var N = $(document);
        C.width(N.width()).height(N.height());
        $.each(K, function (O, P) {
            P.css("display", L ? "block" : "none")
        });
        if (J.is("visible")) {
            $("body").bind("touchmove", A)
        } else {
            $("body").unbind("touchmove", A)
        }
    };

    function A(L) {
        L.preventDefault()
    }
    if (E.clickBackgroundToClose) {
        C.click(function (L) {
            H(false)
        })
    }
    if (E.useCloseButton) {
        D.click(function (L) {
            H(false)
        })
    } else {
        C.click(function (L) {
            H(false)
        })
    }
    return {
        getDialog: function () {
            return J
        },
        getLeftArrow: function () {
            return B
        },
        getRightArrow: function () {
            return F
        },
        getCloseButton: function () {
            return D
        },
        showModal: H,
        showLeftArrow: function (L) {
            var L = L ? true : false;
            B.css("display", L ? "block" : "none")
        },
        showRightArrow: function (L) {
            var L = L ? true : false;
            F.css("display", L ? "block" : "none")
        }
    }
};
nike.cq.UI.Component = nike.cq.UI.Component || {};
nike.cq.UI.Component.extend = function (A) {
    nike.cq.UI.extend.call(this, A)
};
nike.cq.UI.Component.extend({
    remove: function () {
        config.element.remove()
    }
});
nike.cq.UI.Component.extend({
    Flash: {
        getFlashElements: function () {
            return $(".nike-cq-flash-component")
        },
        embedFlash: function (K) {
            var K = K || {}, A = K.src || "",
                B = K.id || "",
                C = K.width || "",
                J = K.height || "",
                E = K.requiredVersion || "9.0.0",
                F = K.installUrl || "",
                H = K.flashVars || {}, D = K.params || {}, G = K.attributes || {}, I = K.onLoad || function () {};
            swfobject.embedSWF(A, B, C, J, E, F, H, D, G, I)
        },
        initialize: function (B) {
            var E = this,
                F = !$.isPlainObject(B),
                A = "nike-cq-flash-component-" + new Date().getTime() + Math.floor(Math.random() * 1000),
                C = (F && B ? $(B) : B && B.element ? $(B.element) : $("<div>", {
                    "class": "nike-cq-flash-component"
                })).attr("id", A),
                D = new nike.cq.Content.Component.Flash(F ? C : B),
                H = !F ? B.onInit || function () {} : function () {}, G = !F ? B.onLoad || function () {} : function () {};
            $.extend(this, {
                getElement: function () {
                    return C
                }
            });
            (function I() {
                E.embedFlash({
                    src: D.getSrc(),
                    id: A,
                    width: D.getWidth(),
                    height: D.getHeight(),
                    flashVars: D.getFlashVars(),
                    params: {
                        play: D.getAutoPlay(),
                        loop: D.getLoop(),
                        menu: D.getMenu(),
                        wmode: D.getWMode(),
                        quality: D.getQuality(),
                        scale: D.getScale(),
                        salign: D.getSAlign(),
                        bgcolor: D.getBgColor(),
                        base: D.getBase(),
                        swliveconnect: D.getSWLiveConnect(),
                        devicefont: D.getDeviceFont(),
                        allowscriptaccess: D.getAllowScriptAccess(),
                        seamlesstabbing: D.getSeamlessTabbing(),
                        allowfullscreen: D.getAllowFullScreen(),
                        allownetworking: D.getAllowNetworking()
                    },
                    onLoad: function (J) {
                        G.call(E, J.ref)
                    }
                });
                H.call(E)
            }).call(this)
        }
    }
});
nike.cq.UI.Component.extend({
    playerRef: null,
    experienceModuleRef: null,
    videoPlayerRef: null,
    onVideoTemplateLoaded: function (A) {
        nike.cq.UI.Component.playerRef = brightcove.getExperience(A);
        nike.cq.UI.Component.experienceModuleRef = nike.cq.UI.Component.playerRef.getModule(APIModules.EXPERIENCE);
        nike.cq.UI.Component.videoPlayerRef = nike.cq.UI.Component.playerRef.getModule(APIModules.VIDEO_PLAYER)
    },
    getVideoPlayerElements: function () {
        return $(".nike-cq-video-player-component")
    },
    VideoPlayer: function (elementOrConfig) {
        var pseudoUniqueId = "nike-cq-video-player-component-" + new Date().getTime() + Math.floor(Math.random(1000)),
            isElement = !$.isPlainObject(elementOrConfig),
            element = (isElement && elementOrConfig ? $(elementOrConfig) : elementOrConfig && elementOrConfig.element ? $(elementOrConfig.element) : $("<div>", {
                "class": "nike-cq-video-player-component"
            })).attr("id", pseudoUniqueId),
            config = $.extend(true, {
                data: {},
                onInit: function () {},
                onLoad: function () {},
                onRemove: function () {}
            }, !isElement ? elementOrConfig : {}),
            dataLength = (function () {
                var length = 0;
                for (dataItem in config.data) {
                    length++
                }
                return length
            })(),
            videoPlayer = new nike.cq.Content.Component.VideoPlayer(dataLength > 0 ? config.data : element),
            BaseVideoPlayer = function (config) {
                this.element = null;
                this.objectTag = $("<div>");
                this.objectTagId = "";
                this.isValid = typeof (config.isValid) == "function" ? config.isValid : function () {
                    return false
                };
                this.remove = typeof (config.remove) == "function" ? config.remove : function () {};
                this.generate = typeof (config.generate) == "function" ? config.generate : function (data, element) {};
                this.controlsElement = null;
                this.getControlsElement = function () {
                    return this.controlsElement
                };
                this.generateControls = function (config) {
                    var config = $.extend({
                        appendTo: $("<div>"),
                        autoPlay: false,
                        defaultWidth: "100%",
                        onPlayEvent: "onVideoPlaying",
                        onPauseEvent: "onVideoPaused",
                        registerEvent: function (eventName, callback) {},
                        onReady: function () {},
                        play: function () {},
                        pause: function () {},
                        stop: function () {},
                        seek: function () {},
                        getTotalTime: function () {},
                        getCurrentPosition: function () {}
                    }, config),
                        element = config.appendTo,
                        playText = "",
                        pauseText = "",
                        stopText = "";
                    var playPause = $("<button>", {
                        "class": "video-playback-control-playpause " + (config.autoPlay ? "video-playback-control-pause" : "video-playback-control-play")
                    }),
                        stop = $("<button>", {
                            "class": "video-playback-control-stop"
                        }),
                        playhead = $("<span>", {
                            "class": "video-playback-control-playhead",
                            css: {
                                position: "absolute",
                                left: 0
                            }
                        }),
                        progress = $("<span>", {
                            "class": "video-playback-control-progress",
                            css: {
                                position: "absolute"
                            }
                        }).append(playhead),
                        progressContainer = $("<span>", {
                            "class": "video-playback-control-progress-container",
                            css: {
                                position: "absolute",
                                cursor: "hand"
                            }
                        }).append(progress),
                        currentTime = $("<span>", {
                            "class": "video-playback-control-current-time",
                            text: "0:00"
                        }),
                        timeDivider = $("<span>", {
                            "class": "video-playback-control-time-divider",
                            text: "/"
                        }),
                        totalTime = $("<span>", {
                            "class": "video-playback-control-total-time",
                            text: "0:00"
                        }),
                        timeContainer = $("<span>", {
                            "class": "video-playback-control-time-container"
                        }).append(currentTime).append(timeDivider).append(totalTime),
                        container = $("<div>", {
                            "class": "video-playback-controls",
                            css: {
                                width: config.defaultWidth
                            }
                        }).append(playPause).append(stop).append(progressContainer).append(timeContainer);
                    nike.cq.Content.i18n.get({
                        play: "Play",
                        pause: "Pause",
                        stop: "Stop"
                    }, function (i18n) {
                        playText = i18n.play;
                        pauseText = i18n.pause;
                        stopText = i18n.stop;
                        playPause.text(config.autoPlay ? playText : pauseText);
                        stop.text(stopText)
                    });
                    this.controlsElement = container;
                    element.append(container);
                    element.delegate(".video-playback-control-pause", "click", function (e) {
                        e.preventDefault();
                        config.pause()
                    }).delegate(".video-playback-control-play", "click", function (e) {
                        e.preventDefault();
                        config.play()
                    }).delegate(".video-playback-control-stop", "click", function (e) {
                        e.preventDefault();
                        config.stop()
                    }).delegate(".video-playback-control-progress-container", "click", function (e) {
                        e.preventDefault();
                        playhead.css("left", e.offsetX);
                        var jumpTo = Math.round(config.getTotalTime() * (e.offsetX / $(this).width()));
                        config.seek(jumpTo)
                    });
                    config.onReady(function () {
                        config.registerEvent(config.onPlayEvent, function () {
                            playPause.removeClass("video-playback-control-play").addClass("video-playback-control-pause").text(pauseText)
                        });
                        config.registerEvent(config.onPauseEvent, function () {
                            playPause.removeClass("video-playback-control-pause").addClass("video-playback-control-play").text(playText)
                        });
                        var isTotalTimeSet = false,
                            totalTimeVal = 0,
                            lastCurrentTime = 0;
                        var interval = window.setInterval(function () {
                            if (!isTotalTimeSet) {
                                totalTimeVal = config.getTotalTime() / 60;
                                var totalTimeMinutes = Math.floor(totalTimeVal),
                                    totalTimeSeconds = Math.round((totalTimeVal - totalTimeMinutes) * 60),
                                    totalTimeSeconds = totalTimeSeconds < 10 && totalTimeSeconds >= 0 ? "0" + totalTimeSeconds : totalTimeSeconds;
                                if (totalTimeVal > 0) {
                                    totalTime.text(totalTimeMinutes + ":" + totalTimeSeconds);
                                    isTotalTimeSet = true
                                }
                            }
                            var currentTimeVal = config.getCurrentPosition() / 60,
                                currentTimeMinutes = Math.floor(currentTimeVal),
                                currentTimeSeconds = Math.round((currentTimeVal - currentTimeMinutes) * 60),
                                currentTimeSeconds = currentTimeSeconds < 10 && currentTimeSeconds >= 0 ? "0" + currentTimeSeconds : currentTimeSeconds;
                            if (lastCurrentTime != currentTimeVal) {
                                currentTime.text(currentTimeMinutes + ":" + currentTimeSeconds);
                                var pos = Math.round((currentTimeVal / totalTimeVal) * progressContainer.width());
                                progress.width(pos);
                                playhead.css("left", pos);
                                lastCurrentTime = currentTimeVal
                            }
                        }, 500)
                    })
                };
                return this
            }, BrightcoveVideoPlayer = new BaseVideoPlayer({
                isValid: function (data) {
                    return data.getVideoId() != "" && data.getPlayerId() != ""
                },
                generate: function (data, element, onLoad) {
                    var pseudoUniqueObjectId = "nike-cq-video-player-component-" + new Date().getTime() + Math.floor(Math.random() * 1000) + "-object",
                        locale = nike.cq.Content.getPageData("locale"),
                        useSecureConnection = (window.location.protocol == "https:") ? true : false,
                        brightcoveDomain = (useSecureConnection) ? "https://sadmin.brightcove.com" : "http://admin.brightcove.com",
                        objectTag = $(['<object id="', pseudoUniqueObjectId, '">', '<param name="wmode" value="transparent" />', '<param name="bgcolor" value="#FFFFFF" />', '<param name="width" value="', data.getWidth(), '" />', '<param name="height" value="', data.getHeight(), '" />', '<param name="playerID" value="', data.getPlayerId(), '" />', '<param name="isVid" value="true" />', '<param name="isUI" value="true" />', '<param name="autoStart" value="', data.getAutoStart(), '"  />', '<param name="@videoPlayer" value="', data.getVideoId(), '" />', '<param name="locale" value="', locale, '" />', '<param name="templateLoadHandler" value="nike.cq.UI.Component.onVideoTemplateLoaded" />', '<param name="labels" value="http://assets.nikevideo.nike.com/video_player/xml/translate/2.0/', locale, '_Labels.xml" />', '<param name="linkBaseUrl" value="', window.location.href, '" />', '<param name="secureConnections" value="', useSecureConnection, '" />', "</object>"].join("")),
                        player = "",
                        experience = "",
                        experienceModule = "";
                    var onReady = function () {
                        if (document.getElementById(element.get(0).id)) {
                            element.empty();
                            brightcove.createExperience(objectTag.get(0), element.get(0), true);
                            onLoad()
                        } else {
                            window.setTimeout(onReady, 100)
                        }
                    };
                    var onTemplateLoaded = function (id) {};
                    var onTemplateReady = function () {};
                    var onVideoComplete = function () {
                        if (config.onVideoComplete) {
                            var customFunction = eval(config.onVideoComplete);
                            if (typeof (customFunction) === "function") {
                                customFunction.call(this)
                            }
                        }
                    };
                    if (typeof (brightcove) == "object") {
                        onReady()
                    } else {
                        $.getScript(brightcoveDomain + "/js/BrightcoveExperiences.js", function () {
                            $.getScript(brightcoveDomain + "/js/APIModules_all.js", function () {
                                onReady()
                            })
                        })
                    }
                    this.element = element;
                    this.objectTag = objectTag;
                    this.objectTagId = pseudoUniqueObjectId
                },
                remove: function () {
                    if (typeof (brightcove) == "object" && nike.cq.UI.Component.experienceModuleRef) {
                        nike.cq.UI.Component.experienceModuleRef.unload();
                        document.getElementById(this.objectTagId).parentNode.innerHTML = ""
                    }
                }
            }),
            SinaVideoPlayer = new BaseVideoPlayer({
                isValid: function (data) {
                    return data.getVideoId() != ""
                },
                generate: function (data, element, onLoad) {
                    var that = this;
                    if (nike.cq.Utils.hasFlash()) {
                        var pseudoUniqueId = "nike-cq-video-player-component-" + new Date().getTime() + Math.floor(Math.random() * 1000) + "-object",
                            videoContainer = $("<div>", {
                                id: pseudoUniqueId
                            });
                        element.empty().append(videoContainer);
                        var swfBridge = nike.cq.Utils.FlashBridge.getSWF(pseudoUniqueId);
                        nike.UI.embedFlash({
                            src: "/etc/designs/nike/resources/video/sina/SinaPlayer.swf",
                            id: pseudoUniqueId,
                            width: data.getWidth(),
                            height: data.getHeight(),
                            flashVars: {
                                videoID: data.getVideoId(),
                                swfLocation: "/etc/designs/nike/resources/video/sina/",
                                autoPlay: true,
                                onReady: swfBridge.onReady()
                            },
                            params: {
                                wmode: "opaque",
                                menu: false,
                                allowScriptAccess: "always",
                                bgcolor: "#000000"
                            },
                            onLoad: function (movie) {
                                var swf = movie.ref;
                                that.generateControls({
                                    autoPlay: false,
                                    appendTo: element,
                                    play: function () {
                                        swf.play()
                                    },
                                    pause: function () {
                                        swf.pause()
                                    },
                                    stop: function () {
                                        swf.stop()
                                    },
                                    seek: function (pos) {
                                        swf.seek(pos)
                                    },
                                    getTotalTime: function () {
                                        return swf.getVideoTotalTime()
                                    },
                                    getCurrentPosition: function () {
                                        return swf.getVideoCurrentPosition()
                                    },
                                    onPlayEvent: "onVideoPlaying",
                                    onPauseEvent: "onVideoPaused",
                                    registerEvent: function (eventName, callback) {
                                        swf.addEventListener(swfBridge.createEventHandler(eventName, callback))
                                    },
                                    onReady: swfBridge.onReady
                                });
                                onLoad()
                            }
                        })
                    }
                    this.element = element
                },
                remove: function () {
                    config.element.remove()
                }
            });
        var videoObj;
        switch (videoPlayer.getPlayerType()) {
            case nike.cq.Content.Component.VideoPlayerType.BRIGHTCOVE:
                videoObj = BrightcoveVideoPlayer;
                break;
            case nike.cq.Content.Component.VideoPlayerType.SINA:
                videoObj = SinaVideoPlayer;
                break;
            case nike.cq.Content.Component.VideoPlayerType.NONE:
            default:
                if (!isElement && !config.data.playerType) {
                    config.data.playerType = nike.cq.Content.Component.VideoPlayerType.BRIGHTCOVE;
                    videoPlayer = new nike.cq.Content.Component.VideoPlayer(dataLength > 0 ? config.data : element);
                    videoObj = BrightcoveVideoPlayer
                } else {
                    videoObj = new BaseVideoPlayer()
                }
                break
        }
        $.extend(this, {
            getElement: function () {
                return config.element
            },
            getControlsElement: function () {
                return videoObj.getControlsElement()
            },
            remove: function () {
                videoObj.remove();
                config.onRemove.call(this)
            }
        });
        (function init() {
            var that = this;
            config.element = element;
            if (videoObj.isValid(videoPlayer)) {
                config.onInit.call(this);
                videoObj.generate(videoPlayer, config.element, function () {
                    config.onLoad.call(that)
                })
            }
        }).call(this);
        return this
    }
});
nike.cq.UI.Component.extend({
    PesCarousel: function (F, n) {
        var h = 10;
        var p = !$.isPlainObject(F),
            S = p && F ? $(F) : F && F.element ? $(F.element) : $(document.createElement("div")),
            Y = $(S).clone(),
            V = S.children(),
            U = V.length,
            D = new nike.cq.Content.Component.PesCarousel(F),
            P = D.getNumberOfSlidesInViewPort(),
            j = D.getWidth(),
            g = D.getHeight(),
            X = D.displayControlsInViewPort(),
            f = D.displayControlsAtBottom(),
            a = D.displayCarouselAnimation(),
            I = D.getDelay(),
            m = D.getSlideBy(),
            o = D.getContinuousLoop(),
            Q = j / P,
            q = g,
            L = $(window).width(),
            K = 12,
            Z = 0,
            H = 0,
            A, B = 140,
            N = (Q * U) + (h * 2 * U),
            l = j + (h * 2 * (P - 1)),
            i = l + B,
            k = i,
            M = g / l,
            c = g,
            E = 0,
            O = 0,
            R = 0,
            d = 0,
            T = 70;
        options = $.extend({
            arrow: "split",
            loop: 30,
            arrowClass: "arrow",
            leftArrowClass: "left",
            rightArrowClass: "right",
            slideClass: "slide",
            slideContainerClass: "slides-container",
            controlClass: "control",
            unselectableClass: " unselectable",
            controlActiveClass: "control-active",
            controlHoverClass: "control-hover",
            controlContainerClass: "control-container",
            separatorClass: "slides-seperator",
            pageNavClass: "nav",
            slidePeriod: 1000
        }, !p ? F : {}, n ? n : {});
        var b = function (r) {
            S.find("." + options.controlClass).each(function () {
                var s = $(this);
                if (o) {
                    s.css("visibility", "visible");
                    if (!s.prop("direction")) {
                        if (s.prop("page") != r) {
                            s.toggleClass(options.controlActiveClass, false)
                        } else {
                            s.toggleClass(options.controlActiveClass, true)
                        }
                    }
                } else {
                    if (s.prop("direction") === 1) {
                        if (r < Z - 1) {
                            s.css("visibility", "visible")
                        } else {
                            s.css("visibility", "hidden")
                        }
                    } else {
                        if (s.prop("direction") === -1) {
                            if (r > 0) {
                                s.css("visibility", "visible")
                            } else {
                                s.css("visibility", "hidden")
                            }
                        } else {
                            if (s.prop("page") != r) {
                                s.toggleClass(options.controlActiveClass, false)
                            } else {
                                s.toggleClass(options.controlActiveClass, true)
                            }
                        }
                    }
                }
            })
        };
        var C = function (u, w) {
            var s = 0;
            if (H) {
                var r = S.find("." + options.slideContainerClass);
                if (o) {
                    var v = false;
                    if (u <= 0) {
                        s = (u !== 0) ? u : 0;
                        r.css("margin-left", -(U - P - (P - m - s)) * (Q + (h * 2)));
                        u = U + s - (2 * P)
                    } else {
                        if (u >= (U - (2 * P - 1))) {
                            s = (u !== (U - (P))) ? u - (U - (P)) : 0;
                            r.css("margin-left", -(P - m + s) * (Q + (h * 2)));
                            u = P + s
                        }
                    }
                }
                r.queue(function () {
                    b(u);
                    $(this).prop("page", u);
                    $(this).dequeue()
                });
                var t = (-u * (Q + (h * 2)) + E);
                var u = u;
                if (w) {
                    r.css({
                        "margin-left": (t) + "px"
                    })
                } else {
                    r.stop().animate({
                        "margin-left": (t) + "px"
                    }, options.slidePeriod, "swing", function () {
                        A = window.setTimeout(function () {
                            if (a && o) {
                                C(u + m)
                            }
                        }, I)
                    })
                }
            }
            if ($(S).find(".nike-cq-notification-banner-container").length) {
                R = u
            }
        };
        var J = function () {
            if (X && H) {
                var t = $(document.createElement("span")).addClass(options.arrowClass);
                leftArrow = $(document.createElement("div")).prop("direction", -1).addClass(options.controlClass + options.unselectableClass).append(t.clone().addClass(options.leftArrowClass).html('<span style="padding-left: 5px; width: 33px; height:59px"></span>'));
                rightArrow = $(document.createElement("div")).prop("direction", 1).addClass(options.controlClass + options.unselectableClass).append(t.clone().addClass(options.rightArrowClass).html('<span style="padding-right: 5px; width: 33px; height:59px"></span>'));
                leftArrow.css("visibility", "hidden");
                rightArrow.css("visibility", "hidden");
                S.append(leftArrow, rightArrow)
            }
            if (f && H) {
                var v = $(document.createElement("span")).addClass(options.pageNavClass + " " + options.controlClass + " " + options.unselectableClass).append("<span>&bull;</span>");
                if (o) {
                    for (var s = 1; s < Z - P; s++) {
                        S.append(v.clone().prop("page", s))
                    }
                } else {
                    for (var s = 0; s < Z; s++) {
                        S.append(v.clone().prop("page", s))
                    }
                }
                var r = $(document.createElement("div")).addClass(options.controlContainerClass);
                var u = $(".nike-cq-portrait-merch-zone-carousel-container .nike-cq-carousels-cta-resource");
                if (u.length) {
                    u.addClass("spaced")
                }
            }
            S.find("." + options.pageNavClass).addClass(options.controlClass).hover(function () {
                $(this).toggleClass(options.controlHoverClass)
            }).wrapAll(r)
        };
        var W = function () {
            Q = (l - (2 * h * (P - 1))) / P;
            if (Q < d) {
                Q = d
            } else {
                if (Q > 300) {
                    Q = 300
                }
            }
            N = (Q * U) + (h * 2 * U)
        };
        var e = function (t) {
            L = $(window).width();
            var r = 1;
            if (L <= 768) {
                if (P >= 3) {
                    P = 3;
                    i = 768;
                    l = 728;
                    T = 20
                }
                d = 217
            } else {
                if (L <= 1400) {
                    if (P >= 3) {
                        P = 3;
                        if (L < k) {
                            i = L
                        }
                        l = i - (B - 60) - 40;
                        N = (Q * (U + 1)) + (h * 2 * U);
                        var y = l % (Q + (h * 2));
                        var AC = y != 0;
                        if (i > 1066 && AC) {
                            if ((Q - y) <= 74) {
                                l = (l - y) + Q
                            } else {
                                if (y > Q) {
                                    y = y - Q;
                                    l = (l - y)
                                } else {
                                    l = (l - y)
                                }
                            }
                            T = (L - l) / 2
                        } else {
                            T = 60
                        }
                    }
                    var AB = 3 * (d + (h * 2));
                    if (l <= AB) {
                        l = AB;
                        T = 40
                    }
                    W()
                } else {
                    if (L > 1400) {
                        T = 70;
                        N = (Q * U) + (h * 2 * U);
                        l = j + (h * 2 * (P - 1));
                        i = l + B
                    }
                }
            }
            H = o || (U > P);
            Z = (U - P) + r;
            if (t) {
                W();
                S.css({
                    width: i + "px"
                });
                S.find("." + options.slideContainerClass).css({
                    width: N + "px"
                });
                S.find("." + options.slideClass).css({
                    width: Q + "px"
                });
                S.children(".window-carousel-container").css({
                    width: l + "px",
                    "margin-left": T + "px",
                    "margin-right": T + "px"
                });
                S.find(".control-container").remove();
                S.find(".control.unselectable").remove();
                J();
                b(R);
                C(R, true);
                S.find("." + options.controlClass).click(function () {
                    var AF = S.find("." + options.slideContainerClass);
                    a = false;
                    window.clearTimeout(A);
                    var AD = $(this).prop("direction");
                    var AE;
                    if (AD) {
                        var AG = AF.prop("page") || 0;
                        gotoPage = (AG + AD < U && AG + AD >= 0) ? AG + AD * (m) : AG + (m - 1)
                    } else {
                        gotoPage = $(this).prop("page") + (m - 1)
                    }
                    R = gotoPage;
                    C(gotoPage)
                })
            } else {
                if (o && H) {
                    $element = $(S);
                    for (var v = 0; v < (P); v++) {
                        var w = $(V[v]).clone().addClass("clone"),
                            AA = $(V[U - (v + 1)]).clone().addClass("clone");
                        $element.prepend(AA).append(w)
                    }
                    V = S.children();
                    U = U + (P * 2)
                }
                Z = (U - P) + r;
                W();
                S.css({
                    width: i + "px",
                    display: "block",
                    position: "relative"
                });
                var x = $(document.createElement("div")).addClass(options.slideClass).css({
                    width: Q + "px",
                    "text-align": "center"
                });
                V.wrap(x);
                V.each(function (AD, AE) {
                    $(AE).parent().attr("data-slide-index", AD + 1)
                });
                var u = $(document.createElement("div")).css({
                    width: N + "px",
                    overflow: "hidden"
                }).addClass(options.slideContainerClass).prop("page", 0);
                var s = $(document.createElement("div")).addClass("window-carousel-container").css({
                    width: l + "px",
                    "margin-left": T + "px",
                    overflow: "hidden",
                    position: "relative"
                });
                S.children("." + options.slideClass).wrapAll(u);
                S.children("." + options.slideContainerClass).wrapAll(s);
                var z = $(document.createElement("div")).addClass(options.separatorClass);
                S.append(z);
                J();
                if (o) {
                    S.find("." + options.slideContainerClass).css("margin-left", -(P) * (Q + (h * 2)));
                    $(this).prop("page", P);
                    b(P);
                    C(P)
                } else {
                    C(0);
                    b(0)
                }
                S.find("." + options.controlClass).click(function () {
                    var AF = S.find("." + options.slideContainerClass);
                    a = false;
                    window.clearTimeout(A);
                    var AD = $(this).prop("direction");
                    var AE;
                    if (AD) {
                        var AG = AF.prop("page") || 0;
                        gotoPage = (AG + AD < U && AG + AD >= 0) ? AG + AD * (m) : AG + (m - 1)
                    } else {
                        gotoPage = $(this).prop("page") + (m - 1)
                    }
                    R = gotoPage;
                    C(gotoPage)
                })
            }
        };
        var G = function (t) {
            P = D.getNumberOfSlidesInViewPort();
            L = $(window).width();
            var r = 1;
            if ($(S).find(".nike-cq-content-slide-540-container").length) {
                if (L <= 768) {
                    i = 768;
                    l = 768;
                    N = ((Q + h * 2) * U);
                    Q = 768;
                    h = 0;
                    T = 0
                } else {
                    if (L <= 1024) {
                        i = L;
                        l = L;
                        Q = L;
                        h = 0;
                        T = 0
                    } else {
                        h = 10;
                        i = (j + (P * 2 * h) + (K * (h)));
                        l = ((Q + h * 2) * P);
                        N = ((Q + h * 2) * U)
                    }
                }
            } else {
                if ($(S).find(".nike-cq-nikeplus-activity-tout-container").length) {
                    if (L <= 768) {
                        i = 768;
                        l = 620;
                        T = 74;
                        if (P >= 3) {
                            P = 2
                        }
                    } else {
                        if (L <= 1024) {
                            T = 40;
                            i = L;
                            l = L - (T * 2)
                        } else {
                            T = 60;
                            i = (j + (P * 2 * h) + (K * (h)));
                            l = ((Q + h * 2) * P);
                            N = ((Q + h * 2) * U)
                        }
                    }
                }
            }
            H = U > P;
            Z = (U - P) + r;
            if (t) {
                S.css({
                    width: i + "px"
                });
                S.find("." + options.slideContainerClass).css({
                    width: N + "px",
                    margin: "0px auto"
                });
                S.find("." + options.slideClass).css({
                    width: Q + "px"
                });
                S.children(".window-carousel-container").css({
                    width: l + "px",
                    margin: "0 auto"
                });
                S.find(".control-container").remove();
                S.find(".control.unselectable").remove();
                J();
                b(R);
                C(R, true);
                S.find("." + options.controlClass).click(function () {
                    var AB = S.find("." + options.slideContainerClass);
                    a = false;
                    window.clearTimeout(A);
                    var AA = $(this).prop("direction");
                    var AD;
                    if (AA) {
                        var AC = AB.prop("page") || 0;
                        AD = (AC + AA < U && AC + AA >= 0) ? AC + AA * (m) : AC + (m - 1)
                    } else {
                        AD = $(this).prop("page") + (m - 1)
                    }
                    R = AD;
                    C(AD)
                })
            } else {
                if (o && H) {
                    $element = $(S);
                    for (var v = 0; v < (P); v++) {
                        var w = $(V[v]).clone().addClass("clone"),
                            z = $(V[U - (v + 1)]).clone().addClass("clone");
                        $element.prepend(z).append(w)
                    }
                    V = S.children();
                    U = U + (P * 2);
                    N = ((Q + h * 2) * U)
                }
                Z = (U - P) + r;
                S.css({
                    width: i + "px",
                    display: "block",
                    position: "relative"
                });
                var x = $(document.createElement("div")).addClass(options.slideClass).css({
                    width: Q + "px",
                    height: q + "px",
                    "margin-left": h + "px",
                    "margin-right": h + "px",
                    "text-align": "center"
                });
                V.wrap(x);
                var u = $(document.createElement("div")).css({
                    width: N + "px",
                    height: g + "px",
                    "margin-left": "0px",
                    overflow: "hidden"
                }).addClass(options.slideContainerClass).prop("page", 0);
                var s;
                if ($(S).find(".nike-cq-content-slide-540-container").length) {
                    s = $(document.createElement("div")).addClass("window-carousel-container").css({
                        width: l + "px",
                        height: g + "px",
                        margin: "0 auto ",
                        overflow: "hidden",
                        position: "relative"
                    })
                } else {
                    if ($(S).find(".nike-cq-nikeplus-activity-tout-container").length) {
                        s = $(document.createElement("div")).addClass("window-carousel-container").css({
                            width: l + "px",
                            margin: "0 auto ",
                            height: g + "px",
                            overflow: "hidden",
                            position: "relative"
                        })
                    } else {
                        if ($(S).find(".nike-cq-notification-banner-container").length) {
                            s = $(document.createElement("div")).addClass("window-carousel-container").css({
                                width: l + "px",
                                height: g + "px",
                                margin: "0 auto ",
                                overflow: "hidden",
                                position: "relative"
                            })
                        }
                    }
                }
                S.children("." + options.slideClass).wrapAll(u);
                S.children("." + options.slideContainerClass).wrapAll(s);
                var y = $(document.createElement("div")).addClass(options.separatorClass);
                S.append(y);
                if ($(S).find(".nike-cq-notification-banner-container").length) {
                    $(".nike-cq-notification-carousel-container .nike-cq-carousels-carousel-resource").css("visibility", "visible")
                }
                J();
                if (o) {
                    S.find("." + options.slideContainerClass).css("margin-left", -(P) * (Q + (h * 2)));
                    $(this).prop("page", P);
                    b(P);
                    C(P)
                } else {
                    C(0);
                    b(0)
                }
                S.find("." + options.controlClass).click(function () {
                    var AB = S.find("." + options.slideContainerClass);
                    a = false;
                    window.clearTimeout(A);
                    var AA = $(this).prop("direction");
                    var AD;
                    if (AA) {
                        var AC = AB.prop("page") || 0;
                        AD = (AC + AA < U && AC + AA >= 0) ? AC + AA * (m) : AC + (m - 1)
                    } else {
                        AD = $(this).prop("page") + (m - 1)
                    }
                    R = AD;
                    C(AD)
                })
            }
        };
        (function () {
            if ($(S).find(".nike-cq-portrait-tout-300-container").length) {
                E = -10;
                d = 220;
                $(window).bind("orientationchange", function () {
                    e(true)
                });
                window.onresize = function (r) {
                    e(true)
                };
                e()
            } else {
                if ($(S).find(".nike-cq-content-slide-540-container").length) {
                    $(window).bind("orientationchange", function () {
                        G(true)
                    });
                    window.onresize = function (r) {
                        G(true)
                    };
                    G()
                } else {
                    if ($(S).find(".nike-cq-nikeplus-activity-tout-container").length) {
                        $(window).bind("orientationchange", function () {
                            G(true)
                        });
                        window.onresize = function (r) {
                            G(true)
                        };
                        G()
                    } else {
                        if ($(S).find(".nike-cq-notification-banner-container").length) {
                            $(window).bind("orientationchange", function () {
                                G(true)
                            });
                            window.onresize = function (r) {
                                G(true)
                            };
                            G()
                        }
                    }
                }
            }
        })();
        return {
            slideTo: C
        }
    }
});
nike.cq.UI.Component.extend({
    Share: function (J) {
        var P = !$.isPlainObject(J),
            O = "share-component-" + new Date().getTime() + Math.floor(Math.random() * 1000),
            C = (P && J ? $(J) : J && J.element ? $(J.element) : $("<aside>", {
                "class": "share-component"
            })).attr("id", O),
            X = $.extend({
                onInit: function () {}
            }, !P ? J : {}),
            G = encodeURIComponent(nike.cq.Content.Component.Share.getUrl()),
            Z = nike.cq.Content.Component.Share.getShortUrl(),
            S = nike.cq.Content.getPageData("shareFacebookEnabled"),
            T = nike.cq.Content.getPageData("shareTwitterEnabled"),
            a = nike.cq.Content.getPageData("shareRenrenEnabled"),
            L = nike.cq.Content.getPageData("shareWeiboEnabled"),
            N = nike.cq.Content.getPageData("shareOrkutEnabled"),
            Y = nike.cq.Content.getPageData("shareDeliciousEnabled"),
            F = nike.cq.Content.getPageData("shareDiggEnabled"),
            E = nike.cq.Content.getPageData("shareStumbleuponEnabled"),
            V = nike.cq.Content.getPageData("shareRedditEnabled"),
            K = nike.cq.Content.getPageData("shareQqEnabled"),
            B = nike.cq.Content.getPageData("shareClipboardEnabled"),
            M = B ? nike.cq.Utils.hasFlash() : false,
            I = S || T || a || L || N || K || B || Y || F || E || V,
            R = (function () {
                if (I) {
                    nike.cq.Content.i18n.get("Share", function (b) {
                        $("<h1>", {
                            "class": "share-title",
                            text: b
                        }).prependTo(C)
                    })
                }
            })(),
            U = $("<ul>", {
                "class": "share-items"
            }).appendTo(C),
            W = function (e) {
                var f = e.className || "",
                    i = e.text || "",
                    h = e.content || e.text,
                    b = e.preContent || "",
                    d = e.postContent || "",
                    c = e.url || "";
                var g = $("<li>", {
                    "class": "share-item " + f
                }).append($("<a>", {
                    "class": "share-item-link",
                    href: c,
                    title: i,
                    target: "_blank"
                }).append($("<span>", {
                    "class": "share-item-text",
                    html: h
                }))).appendTo(U);
                (typeof (b) == "function") ? b() : h = b + h;
                (typeof (d) == "function") ? d() : h = h + d;
                return g
            }, D = function () {
                if (document.getElementById(O)) {
                    var d = new ZeroClipboard.Client();
                    var b = C.css("position") || "relative";
                    d.setText(G);
                    d.glue(H.get(0), C.css("position", b).get(0))
                } else {
                    var c = window.setInterval(function () {
                        if (document.getElementById(O)) {
                            var f = new ZeroClipboard.Client();
                            var e = C.css("position") || "relative";
                            f.setText(G);
                            f.glue(H.get(0), C.css("position", e).get(0));
                            c = window.clearInterval(c);
                            c = null;
                            delete c
                        }
                    }, 100)
                }
            }, A = $("<span>", {
                "class": "share-item-text"
            }),
            H = $("<li>", {
                "class": "share-item share-item-clipboard"
            }).append(A);
        $.extend(this, {
            getElement: function () {
                if (M) {
                    D()
                }
                return X.element
            }
        });
        (function Q() {
            X.element = C;
            if (S) {
                nike.cq.Content.i18n.get("ShareOnFacebookText", function (b) {
                    W({
                        className: "share-item-facebook",
                        url: "http://www.facebook.com/sharer.php?u=" + Z,
                        text: b
                    })
                })
            }
            if (T) {
                Nike.Content.i18n.get("ShareOnTwitterText", function (b) {
                    var c = nike.cq.Content.getPageData("socialTweet") || "{PageTitle} - {ShortUrl}";
                    c = c.replace(/\{PageTitle\}/g, document.title).replace(/\{ShortUrl\}/g, Z);
                    W({
                        className: "share-item-twitter",
                        url: "http://twitter.com/share?&text=" + c + "&url=",
                        text: b
                    })
                })
            }
            if (a) {
                nike.cq.Content.i18n.get("ShareOnRenrenText", function (b) {
                    W({
                        className: "share-item-renren",
                        url: "http://share.renren.com/share/buttonshare.do?link=" + Z + "&title=" + document.title + " " + Z,
                        text: b
                    })
                })
            }
            if (L) {
                nike.cq.Content.i18n.get("ShareOnWeiboText", function (b) {
                    W({
                        className: "share-item-weibo",
                        url: "http://v.t.sina.com.cn/share/share.php?url=" + Z + "&title=" + document.title + " " + Z,
                        text: b
                    })
                })
            }
            if (K) {
                nike.cq.Content.i18n.get("ShareOnQQText", function (b) {
                    W({
                        className: "share-item-qq",
                        url: "http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url=" + Z,
                        text: b
                    })
                })
            }
            if (N) {
                nike.cq.Content.i18n.get("ShareOnOrkutText", function (b) {
                    W({
                        className: "share-item-orkut",
                        url: "http://promote.orkut.com/preview?nt=orkut.com&du=" + Z,
                        text: b
                    })
                })
            }
            if (Y) {
                nike.cq.Content.i18n.get("ShareOnDeliciousText", function (b) {
                    W({
                        className: "share-item-delicious",
                        url: "http://www.delicious.com/save?url=" + Z + "&title=" + document.title,
                        text: b
                    })
                })
            }
            if (F) {
                nike.cq.Content.i18n.get("ShareOnDiggText", function (b) {
                    W({
                        className: "share-item-digg",
                        url: "http://digg.com/submit?url=" + Z,
                        text: b
                    })
                })
            }
            if (E) {
                nike.cq.Content.i18n.get("ShareOnStumbleuponText", function (b) {
                    W({
                        className: "share-item-stumbleupon",
                        url: "http://www.stumbleupon.com/submit?url=" + Z,
                        text: b
                    })
                })
            }
            if (V) {
                nike.cq.Content.i18n.get("ShareOnRedditText", function (b) {
                    W({
                        className: "share-item-reddit",
                        url: "http://www.reddit.com/submit?url=" + Z + "&title=" + document.title,
                        text: b
                    })
                })
            }
            if (M) {
                nike.cq.Content.i18n.get("CopyToClipboardText", function (b) {
                    A.text(b)
                });
                ZeroClipboard.setMoviePath("/etc/designs/nike/resources/share/ZeroClipboard10.swf");
                H.appendTo(U);
                D()
            }
            X.onInit.call(this)
        }).call(this);
        return this
    }
});
nike.cq.UI.Component.extend({
    Hotspot: function (F) {
        var B = $(F),
            E = new nike.cq.Content.Component.Hotspot(F),
            H = new Array();
        var A = $("<div>", {
            "class": "nike-cq-hotspot-container"
        });
        A.prop("editMode", false).insertAfter(B);
        var J = $("<a>", {
            "class": "nike-cq-hotspot-component-hotspot",
            target: "_blank"
        }).css({
            position: "absolute",
            display: "block",
            "z-index": 1000
        });
        this.hoverbox = $("<div>", {
            "class": "nike-cq-hotspot-component-hoverbox",
            css: {
                position: "absolute",
                "z-index": 999
            }
        });
        this.hoverboxOn = false;
        var G = this;
        var C = function (L) {
            var M = $(J.clone());
            M.offset({
                top: L.getY(),
                left: L.getX()
            });
            M.width(L.getWidth()).height(L.getHeight());
            if (L.getLink()) {
                M.attr("href", L.getLink())
            }
            M.html("<span>" + L.getData().replace(/\n/g, "<br />") + "</span>");
            M.prop("jcrName", L.getJcrName());
            return M
        };
        var K = E.getData();
        for (var D = 0; D < K.length; D++) {
            var I = C(K[D]);
            I.appendTo(A);
            H.push(I)
        }
        A.delegate(".nike-cq-hotspot-component-hotspot", {
            mouseenter: function (L) {
                if (!A.prop("editMode")) {
                    if (!G.hoverboxOn) {
                        G.hoverboxOn = true;
                        G.hoverbox.insertBefore(this);
                        G.hoverbox.html($(this).html())
                    }
                    G.hoverbox.offset({
                        left: L.pageX,
                        top: L.pageY
                    })
                }
            },
            mousemove: function (L) {
                if (!A.prop("editMode") && G.hoverboxOn) {
                    G.hoverbox.offset({
                        left: L.pageX,
                        top: L.pageY
                    })
                }
            },
            mouseleave: function () {
                if (!A.prop("editMode") && G.hoverboxOn) {
                    G.hoverbox.remove();
                    G.hoverboxOn = false
                }
            }
        });
        B.remove();
        return {
            getSpots: function () {
                return H
            },
            getContainer: function () {
                return A
            }
        }
    }
});
nike.cq.UI.Component.extend({
    Slideshow: function (F, M) {
        var M = M ? M : false,
            j = !$.isPlainObject(F),
            K = (j && F ? $(F) : F && F.element ? $(F.element) : $("<div>")),
            Y = $.extend({
                data: [],
                autoHideControls: true,
                toggleButtonText: true,
                onInit: function () {},
                onSlide: function () {}
            }, !j ? F : {
                element: $(F)
            }),
            L = M ? nike.cq.Content.Component.Carousel : nike.cq.Content.Component.Slideshow,
            O = new L(j ? K : Y.data),
            R = 250,
            G = O.getWait(),
            H = O.getSlides(),
            c = O.getAutoSlide(),
            D = true,
            d = true,
            I = 0,
            B = null,
            P = O.getComponentName(),
            l = O.getPreviousButtonTracking(),
            g = O.getNextButtonTracking(),
            f = O.getNumberedSlideButtonTracking();
        var X = this,
            k = O.getSlides(),
            A = Y.element.find("." + P + "-slide"),
            m = Y.element.find("." + P + "-slides").css("position", "absolute"),
            N = A.length,
            T = function () {
                return A.eq(0).addClass(P + "-slide-selected").outerWidth(true)
            }, h = T(),
            V = function () {
                if (d) {
                    var n = 4;
                    m.width((N + n) * h + (Y.element.outerWidth(true) - h))
                } else {
                    m.width(N * h + (Y.element.outerWidth(true) - h))
                }
            }, E = function () {
                if (d) {
                    J(++I, b)
                } else {
                    if (D) {
                        if (I < N - 1) {
                            J(++I, b)
                        } else {
                            J(0, b)
                        }
                    } else {
                        if (I < N - 1) {
                            J(++I, b)
                        } else {
                            J(N - 1, b)
                        }
                    }
                }
            }, Z = function () {
                if (d) {
                    J(--I, b)
                } else {
                    if (D) {
                        if (I > 0) {
                            J(--I, b)
                        } else {
                            J(N - 1, b)
                        }
                    } else {
                        if (I > 0) {
                            J(--I, b)
                        } else {
                            J(0, b)
                        }
                    }
                }
            }, W = $("<button>", {
                "class": P + "-previous-slide-button " + P + "-button-disabled",
                "data-sitecatalyst": l
            }).hide(),
            S = $("<button>", {
                "class": P + "-next-slide-button " + P + "-button-disabled",
                "data-sitecatalyst": g
            }).hide(),
            a = (function () {
                if (N > 1) {
                    var p = $("<ul>", {
                        "class": P + "-select-slides"
                    }),
                        o = [];
                    for (var n = 0; n < N; n++) {
                        o.push(['<li class="', P, "-select-slide ", P, "-select-slide-", (n + 1), (n == 0 ? " " + P + "-select-slide-selected" : ""), (n + 1 == N ? " " + P + "-select-slide-last" : ""), '"><a data-sitecatalyst="', f, '" data-index="', n, '" class="', P, '-select-slide-link" href="#slide-', (n + 1), '">', (n + 1), "</a></li>"].join(""))
                    }
                    return p.append(o.join(""))
                } else {
                    return null
                }
            })(),
            Q = false,
            J = function (n, p) {
                K.trigger("slidestart");
                if (!h) {
                    h = T();
                    V()
                }
                Q = true;
                var o = d ? 2 : 0;
                m.stop(true, true).animate({
                    left: -h * (n + o)
                }, {
                    duration: R,
                    complete: function () {
                        if (d) {
                            if (n <= -1) {
                                m.css("left", -h * (H.length + 1));
                                I = H.length - 1;
                                K.find("." + P + "-select-slide-selected").removeClass(P + "-select-slide-selected");
                                A.removeClass(P + "-slide-selected");
                                K.find("." + P + "-select-slide").eq(H.length - 1).addClass(P + "-select-slide-selected");
                                A.eq(H.length - 1).addClass(P + "-slide-selected")
                            } else {
                                if (n >= H.length) {
                                    m.css("left", -h * 2);
                                    K.find("." + P + "-select-slide-selected").removeClass(P + "-select-slide-selected");
                                    A.removeClass(P + "-slide-selected");
                                    K.find("." + P + "-select-slide").eq(0).addClass(P + "-select-slide-selected");
                                    A.eq(0).addClass(P + "-slide-selected");
                                    I = 0
                                }
                            }
                        }
                        Q = false;
                        if (p) {
                            p.call(X)
                        }
                    }
                });
                K.find("." + P + "-select-slide-selected").removeClass(P + "-select-slide-selected");
                K.find("." + P + "-select-slide").eq(n).addClass(P + "-select-slide-selected");
                A.removeClass(P + "-slide-selected");
                if (d && n === H.length) {
                    A.eq(0).addClass(P + "-slide-selected")
                } else {
                    A.eq(n).addClass(P + "-slide-selected")
                } if (n <= 0) {
                    W.addClass(P + "-button-disabled")
                } else {
                    W.removeClass(P + "-button-disabled")
                } if (n >= N - 1) {
                    S.addClass(P + "-button-disabled")
                } else {
                    S.removeClass(P + "-button-disabled")
                }
                I = n;
                K.trigger("slideend")
            }, U = function (o, n) {
                return o.getTitle() == n.getTitle() && o.getDescription() == n.getDescription() && o.getImageUrl() == n.getImageUrl()
            }, C = function (n) {
                if (typeof n == "object") {
                    var o = 0;
                    for (var n in k) {
                        if (k.hasOwnProperty(n)) {
                            if (U(slideInstance, n)) {
                                J(o, b);
                                break
                            }
                            o++
                        }
                    }
                } else {
                    J(n, b)
                }
            }, i = Y.onInit || function () {}, b = Y.onSlide || function () {};
        $.extend(this, {
            next: E,
            previous: Z,
            slideTo: C,
            getElement: function () {
                return Y.element
            },
            getCurrentSlide: function () {
                return k[I]
            },
            getSlides: function () {
                return k
            },
            getCurrentSlideIndex: function () {
                return I
            },
            getSlideCount: function () {
                return N
            },
            setSlideWidth: function () {
                h = T();
                V()
            }
        });
        (function e() {
            (function r() {
                nike.cq.Content.i18n.get("PreviousSlide", function (u) {
                    if (Y.toggleButtonText) {
                        W.text(u)
                    } else {
                        $(W).addClass("arrowPrev")
                    }
                });
                nike.cq.Content.i18n.get("NextSlide", function (u) {
                    if (Y.toggleButtonText) {
                        S.text(u)
                    } else {
                        $(S).addClass("arrowNext")
                    }
                })
            })();
            V();
            if (N > 1) {
                Y.element.append(W).append(S).append(a);
                if (d) {
                    var t = $(".nike-cq-story-hero-slideshow-slide");
                    for (var p = 0; p < 2; p++) {
                        var q = $(t[p]).clone().addClass("clone").removeClass(P + "-slide-selected"),
                            o = $(t[t.length - (p + 1)]).clone().addClass("clone").removeClass(P + "-slide-selected");
                        m.prepend(o).append(q)
                    }
                    m.css("left", -h * 2)
                }
                var s = function () {
                    W.show();
                    S.show()
                };
                var n = function () {
                    W.hide();
                    S.hide()
                };
                K.delegate("." + P + "-previous-slide-button", "click", Z).delegate("." + P + "-next-slide-button", "click", E);
                K.delegate("." + P + "-select-slide-link", "click", function (v) {
                    v.preventDefault();
                    B = window.clearInterval(B);
                    var u = $(this).data("index");
                    J(u, function () {
                        B = window.clearInterval(B)
                    })
                });
                if (Y.autoHideControls) {
                    K.bind("mouseenter", function () {
                        B = window.clearInterval(B);
                        s()
                    }).bind("mouseleave", function () {
                        B = window.clearInterval(B);
                        if (c) {
                            B = window.setInterval(E, G)
                        }
                        n()
                    })
                } else {
                    s()
                } if (c) {
                    B = window.setInterval(E, G)
                }
            }
            i.call(this);
            J(0)
        }).call(this)
    },
    getSlideshowElements: function () {
        return $(".nike-cq-slideshow-component")
    },
    getCarouselElements: function () {
        return $(".nike-cq-carousel-component")
    },
    Carousel: function (A) {
        return nike.cq.UI.Component.Slideshow(A, true)
    }
});
nike.cq.UI.Component.extend({
    Product: function () {
        var B = function (D) {
            if (D == undefined) {
                return true
            }
            var C = $("#product-tout-" + D.productId);
            C.find("#productName").html(D.nameLine1);
            C.find("#productCategory").html(D.nameLine2);
            if (D.image != undefined) {
                C.find("#heroImage").attr("src", D.image.url);
                C.find("#heroImage").attr("width", D.image.width);
                C.find("#heroImage").attr("height", D.image.height)
            }
        };
        var A = function (C) {
            var E = $("#" + C).data();
            var F = E.serviceUrl;
            var D = undefined;
            nike.cq.Content.Component.Product.getByUrl(F, this.populateProduct, D)
        };
        return {
            populateProduct: B,
            render: A
        }
    }
});
nike.cq.UI.Component.extend({
    LiquidCarousel: function (B, A) {
        var C = {
            minShiftWidth: 25,
            animationSpeed: 100,
            width: 1426,
            innerMargin: 126,
            scrollingClass: "scrolling",
            multiRowClass: "multisection",
            multiRowSelector: "section.nike-cq-team-selector-section",
            wrapperClass: "nike-cq-team-selector-wrapper",
            outerWrapperClass: "nike-cq-team-selector-outer-wrapper",
            leftArrowClass: "nike-cq-team-selector-left-arrow",
            rightArrowClass: "nike-cq-team-selector-right-arrow",
            handleLeftNav: true,
            leftNavMinBreakpoint: 1009,
            leftNavMaxBreakpoint: 1472,
            leftNavPaddedClassName: "nike-cq-team-selector-pad-left-nav",
            leftNavPadding: 243,
            tabContainer: null
        }, A = $.extend(C, A || {}),
            F = $(B),
            J = this,
            G;
        A.innerWidth = A.width - A.innerMargin;
        F.css("margin-left", "0px");

        function I() {
            F.wrap('<div class="' + A.wrapperClass + '" />');
            J.resourceEl = F;
            J.wrapper = F.parent();
            J.wrapper.css("overflow", "hidden");
            J.wrapper.wrap('<div class="' + A.outerWrapperClass + '" />');
            J.outerWrapper = J.wrapper.parent();
            J.outerWrapper.width(A.width);
            var K = 0;
            var L;
            F.find("ul").each(function (N) {
                var P = $(this);
                var M = P.find("li");
                var Q = M.outerWidth(true);
                var O = M.length * Q;
                if (O > K) {
                    L = P;
                    K = O;
                    G = Q
                }
            });
            F.width(K);
            H();
            D();
            $(window).resize(function () {
                D()
            })
        }
        function H() {
            var M = $("<div />", {
                "class": A.leftArrowClass
            });
            var L = $("<div />", {
                "class": A.rightArrowClass
            });
            J.leftArrow = M;
            J.rightArrow = L;
            J.outerWrapper.append(M).append(L);
            if (A.multiRowSelector && J.wrapper.find(A.multiRowSelector).length > 1) {
                J.leftArrow.addClass(A.multiRowClass);
                J.rightArrow.addClass(A.multiRowClass)
            }
            function O() {
                var P = J.wrapper.width();
                return (G * Math.ceil(P / G)) - P
            }
            function K() {
                return parseInt(F.css("margin-left").replace("px", ""))
            }
            function N() {
                return (K() % G) == 0
            }
            J.leftArrow.bind({
                click: function () {
                    var Q = K();
                    var P = O();
                    if (Q < 0) {
                        var R = (Q + G >= 0) ? 0 : Q + (N() ? G : P >= A.minShiftWidth ? P : (G + P));
                        F.animate({
                            "margin-left": R
                        }, A.animationSpeed, E)
                    }
                }
            });
            J.rightArrow.bind({
                click: function () {
                    var Q = K();
                    var P = O();
                    var R = F.width();
                    if (Q > -R) {
                        var S = Q - (N() ? (P >= A.minShiftWidth ? P : (G + P)) : G);
                        F.animate({
                            "margin-left": S
                        }, A.animationSpeed, E)
                    }
                }
            })
        }
        function D() {
            var K = $(window).width(),
                O = A.handleLeftNav && nike.cq.Utils.detectLeftNav(),
                M = (O && K > A.leftNavMinBreakpoint && K <= (A.leftNavPadding + A.innerMargin + A.width)),
                L, N;
            if (M) {
                J.outerWrapper.parent().addClass(A.leftNavPaddedClassName);
                if (A.tabContainer) {
                    A.tabContainer.addClass(A.leftNavPaddedClassName)
                }
            } else {
                J.outerWrapper.parent().removeClass(A.leftNavPaddedClassName);
                if (A.tabContainer) {
                    A.tabContainer.removeClass(A.leftNavPaddedClassName)
                }
            } if (K > A.width) {
                L = A.innerWidth;
                N = A.width
            } else {
                L = K - A.innerMargin;
                N = K
            } if (M) {
                L -= A.leftNavPadding;
                N -= A.leftNavPadding
            }
            J.wrapper.width(L);
            J.outerWrapper.width(N);
            if (F.width() <= J.wrapper.width()) {
                J.leftArrow.hide();
                J.rightArrow.hide();
                F.removeClass(A.scrollingClass).css("margin", 0);
                return
            }
            J.leftArrow.show();
            J.rightArrow.show();
            F.addClass(A.scrollingClass);
            E()
        }
        function E() {
            var M = F.css("margin-left");
            if (!M) {
                return
            }
            var N = parseInt(M.replace("px", ""), 10);
            if (N >= 0) {
                J.leftArrow.hide()
            } else {
                J.leftArrow.show()
            }
            var L = F.width() - J.wrapper.width();
            var K = L * -1;
            if (N <= K) {
                J.rightArrow.hide()
            } else {
                J.rightArrow.show()
            }
        }
        I()
    }
});
nike.cq.UI.Component.extend({
    Hyperlink: function () {
        var B = null;
        var A = function () {
            clearTimeout(this.timerRef);
            this.timerRef = setTimeout(C, 100)
        };
        var C = function () {
            if ($("div.nike-cq-hyperlink-component").length > 0) {
                classValue = $("div.nike-cq-hyperlink-component").attr("class");
                classValue = classValue.replace("mediumpx", "");
                classValue = classValue.replace("largepx", "");
                if ($(window).width() <= 800) {
                    $("div.nike-cq-hyperlink-component").attr("class", "mediumpx " + classValue)
                } else {
                    $("div.nike-cq-hyperlink-component").attr("class", "largepx " + classValue)
                }
            }
        };
        return {
            clearTime: A
        }
    }
});
var hyperlinkModule = new nike.cq.UI.Component.Hyperlink();
$(window).resize(function () {
    hyperlinkModule.clearTime()
});
$(document).ready(function () {
    hyperlinkModule.clearTime()
});
nike.cq.Tracking = nike.cq.Tracking || {};
nike.cq.Tracking.extend = function (A) {
    nike.cq.extend.call(this, A)
};
nike.cq.Tracking.extend((function () {
    var EventManager = function () {
        var eventConfig, generateEventData = function (eventData) {
                var variableData = {}, el = $(this),
                    data = eventData.data,
                    dataConfig = eventData.dataConfig;
                var enhancedEventData = eventData;
                enhancedEventData.el = el;
                for (var i in data) {
                    if (i == "jcr:primaryType" || i == "events") {
                        continue
                    }
                    variableData[i] = data[i]
                }
                dataConfig.elementText = formatText(el.text());
                if (experienceTracking.eventsProcessor && (typeof (experienceTracking.eventsProcessor) === "function")) {
                    var customData = experienceTracking.eventsProcessor.call(this, enhancedEventData);
                    if (typeof (customData) === "object") {
                        for (var c in customData) {
                            variableData[c] = customData[c]
                        }
                    }
                }
                if (dataConfig.eventProcessor) {
                    var experienceEventProcessor = eval(dataConfig.eventProcessor);
                    if (typeof (experienceEventProcessor) === "function") {
                        var customData = experienceEventProcessor.call(this, enhancedEventData);
                        if (typeof (customData) === "object") {
                            for (var c in customData) {
                                variableData[c] = customData[c]
                            }
                        }
                    }
                }
                for (var v in variableData) {
                    variableData[v] = replaceValues(variableData[v], dataConfig.elementText)
                }
                return variableData
            }, eventProcessor = function (experienceEventProcessor, variableData) {
                var customData = experienceEventProcessor.call(this, eventData);
                if (typeof (customData) === "object") {
                    for (var c in customData) {
                        variableData[c] = customData[c]
                    }
                }
                return variableData
            }, elementEventHandler = function (event) {
                var thisTarget = $(event.currentTarget).attr("target");
                if (thisTarget != "_blank") {
                    event.preventDefault()
                }
                var events = event.data.data.events || "event13",
                    eventName = event.data.eventName,
                    eventData = generateEventData.call(this, event.data),
                    dataConfig = event.data.dataConfig;
                experienceTracking.sendEventTrackingToThirdParty.call(this, eventName, events, eventData);
                if (thisTarget != "_blank") {
                    var configFollowLink = dataConfig.followLink;
                    var dataAttributeFollowLink = $(this).data("followLink");
                    if (typeof dataAttributeFollowLink === "undefined") {
                        if (typeof configFollowLink === "undefined" || configFollowLink == true) {
                            window.setTimeout(function () {
                                window.location.href = event.currentTarget.href
                            }, 300)
                        }
                    } else {
                        if (dataAttributeFollowLink) {
                            window.setTimeout(function () {
                                window.location.href = event.currentTarget.href
                            }, 300)
                        }
                    }
                }
                $(nike.cq.Tracking).trigger("nikeEventTrack", {
                    events: events,
                    data: eventData
                })
            }, processEventConfig = function (eventConfig) {
                eventConfig = $.extend({
                    elementSelector: "",
                    action: "click",
                    data: {},
                    dataConfig: {
                        generatePageActivity: false,
                        pageActivityType: "",
                        addFindMethod: false
                    }
                }, eventConfig);
                if (eventConfig.elementSelector) {
                    var action = eventConfig.action;
                    if (action == "delegate" && eventConfig.delegate) {
                        $(eventConfig.elementSelector).delegate(eventConfig.delegate, eventConfig.delegateAction, eventConfig, elementEventHandler)
                    } else {
                        $(eventConfig.elementSelector).bind(action, eventConfig, elementEventHandler)
                    }
                }
            }, processTrackingConfig = function (config) {
                for (var evt in config) {
                    if (evt == "jcr:primaryType") {
                        continue
                    }
                    processEventConfig(config[evt])
                }
            }, addEvent = function (event) {
                var events = CQ_Analytics.EventDataMgr.getProperty("events"),
                    add = (events) ? events + "," + event : event;
                CQ_Analytics.EventDataMgr.setProperty("events", add);
                return add
            }, initEventTracking = function (config) {
                eventConfig = config;
                processTrackingConfig(config);
                if (experienceTracking.setupEventTracking && (typeof (experienceTracking.setupEventTracking) === "function")) {
                    experienceTracking.setupEventTracking.call()
                }
            };
        return {
            getEventConfig: function () {
                return eventConfig
            },
            addEvent: addEvent,
            initEventTracking: initEventTracking,
            generateEventData: generateEventData
        }
    }();
    var category = nike.cq.Content.getPageData("category"),
        experienceId = nike.cq.Content.getPageData("experienceId"),
        trackingConfigPaths = [],
        experienceTracking, config, formatText = function (text) {
            return $.trim(text).replace(/\s+/g, "-").replace(/[,!$@<>%&;:=`~#'"_\^\*\{\}\.\(\)\[\]\?\/]/g, "").toLowerCase()
        }, formatTextPreservingGreaterThanChar = function (text) {
            return $.trim(text).replace(/\s+/g, "-").replace(/[,!$@<%&;:=`~#'"_\^\*\{\}\.\(\)\[\]\?\/]/g, "").toLowerCase()
        }, replaceValues = function (text, elementText) {
            var ret = (text) ? text : "";
            if (typeof text == "string") {
                if (text.indexOf("[") != -1) {
                    ret = ret.replace("[elementText]", elementText)
                }
            }
            return ret
        }, getConfig = function (config) {
            if (!$.isPlainObject(config)) {
                $.ajax({
                    url: config,
                    dataType: "json",
                    success: function (response) {
                        config = response;
                        if (config.event) {
                            EventManager.initEventTracking(config.event)
                        }
                    },
                    error: function (xhr, status, error) {
                        setupTracking()
                    }
                })
            } else {
                if (config.event) {
                    EventManager.initEventTracking(config.event)
                }
            }
        }, setupTracking = function () {
            getConfig(config)
        }, init = function (experience) {
            experienceTracking = experience;
            config = experienceTracking.config;
            setupTracking()
        };
    return {
        EventManager: EventManager,
        getTrackingConfig: function () {
            return config
        },
        init: init,
        ready: function () {
            return PageManager.ready()
        },
        formatText: formatText,
        formatTextPreservingGreaterThanChar: formatTextPreservingGreaterThanChar,
        replaceValues: replaceValues
    }
})());
nike.cq.UI = nike.cq.UI || {};
nike.cq.UI.TabletSwipeSupport = function (A, D, C, B) {
    A.each(function () {
        var K, F, J, L, I, N, G = this;
        $(G).bind("touchstart", H);

        function H(P) {
            $(G).bind("touchmove", E);
            $(G).bind("touchend", M);
            var O = P.originalEvent.targetTouches[0];
            K = O.clientX
        }
        function E(O) {
            O.preventDefault()
        }
        function M(P) {
            $(G).unbind("touchmove", E);
            $(G).unbind("touchend", M);
            var O = P.originalEvent.changedTouches[0];
            F = O.clientX;
            J = ".arrow.left";
            L = ".arrow.right";
            if (D && C) {
                J = D;
                L = C
            }
            if (B) {
                I = $(".selected").parent("li").next().find("a");
                N = $(".selected").parent("li").prev().find("a");
                J = N;
                L = I
            }
            if (K > F && $(L).is(":visible")) {
                $(G).find(L).trigger("click")
            }
            if (K < F && $(J).is(":visible")) {
                $(G).find(J).trigger("click")
            }
        }
    })
};
